Skip to main content
Solved

Split line with points and keep overlapping segments


julien_m
Contributor
Forum|alt.badge.img+2

Hi,

I want to split lines with points but I really need to keep all the overlaping segments. I tried with the PointOnLineOverlayer but, like the Intersector, in this transformer, all overlapping segments are reduced to one segment before being output.

In the image below, you can imagine a road with a dead end. The result must contain 5 lines and not 4. Moreover, the Intersector isn't good for me because I don't want to split lines on all intersections (only on points).

Sample of my data here :

Thank you very much

 

Julien

Best answer by arnovananrooij

Hi @julien_m,

This is quit a hard one. I tried putting it together myself. I think the result should be 21 lines and 2 overlaps which makes it 23 together. In your drwaing you forgot to count 2 lines. I my workspace I end up with 24 lines so there is one to many, but I could not figure out how to solve that one. Maybe you could have a look at what I tried to do with the chopper and the matcher to find the double lines.

split2waylineswithpoints.fmw

View original
Did this help you find an answer to your question?

14 replies

danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Evangelist
  • February 19, 2019

Hi @julien_m

Did you try to use the Topology Builder?

If you want to share us your vectors to test.

 

Thanks

Danilo


nielsgerrits
VIP
Forum|alt.badge.img+53

Not a solution but the Intersector can output both lines. From the documentation:

Separate Collinear Segments
If Yes - causes overlapping segments not to be merged into a single segment: one copy is output for each original feature sharing the segment. Each such segment will have the respective original feature’s attributes as its main attributes, and attributes from all other collinear features will be added as a list attribute, if the list name was supplied.

When a coverage of polygons is input, the set of topologically significant lines which form their boundaries is output.

 


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 19, 2019
nielsgerrits wrote:

Not a solution but the Intersector can output both lines. From the documentation:

Separate Collinear Segments
If Yes - causes overlapping segments not to be merged into a single segment: one copy is output for each original feature sharing the segment. Each such segment will have the respective original feature’s attributes as its main attributes, and attributes from all other collinear features will be added as a list attribute, if the list name was supplied.

When a coverage of polygons is input, the set of topologically significant lines which form their boundaries is output.

 

I know for the Intersector. The problem with this transformer is that I don't want to split lines on all intersections (only on points). The Intersector cuts the crossing line and I don't want to do this.


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 19, 2019
danilo_fme wrote:

Hi @julien_m

Did you try to use the Topology Builder?

If you want to share us your vectors to test.

 

Thanks

Danilo

I tried the TopologyBuilder but It doesn't cut the line.

Here is a sample of my data (shapefile) : split_but_keep_overlap_segments.zip


danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Evangelist
  • February 19, 2019
julien_m wrote:

I tried the TopologyBuilder but It doesn't cut the line.

Here is a sample of my data (shapefile) : split_but_keep_overlap_segments.zip

Thanks your dataset.

I used here the transformer PointOnLineOverlayer with Point Tolerance 0.1 with sucess.

 

Attached the Workspace template ( .FMWT ) - Workspace_Template.fmwt

 

Thanks,

Danilo


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 19, 2019
danilo_fme wrote:

Thanks your dataset.

I used here the transformer PointOnLineOverlayer with Point Tolerance 0.1 with sucess.

 

Attached the Workspace template ( .FMWT ) - Workspace_Template.fmwt

 

Thanks,

Danilo

Thank you Danilo for your answer. I already tried this. In my sample data, the result must have 23 lines and not 19.

If you look closer at the result after the PointOnLineOverlayer, the self overlap lines seem to be cut only once (not by all points).

The results have to be this :

 

The Intersectors can to that but it cuts the crossing lines and I don't want that. My data contain road with bridge.


danilo_fme
Evangelist
Forum|alt.badge.img+42
  • Evangelist
  • February 19, 2019
julien_m wrote:

Thank you Danilo for your answer. I already tried this. In my sample data, the result must have 23 lines and not 19.

If you look closer at the result after the PointOnLineOverlayer, the self overlap lines seem to be cut only once (not by all points).

The results have to be this :

 

The Intersectors can to that but it cuts the crossing lines and I don't want that. My data contain road with bridge.

Hello,

Please, check the image bellow. The point is not touching the line:

 

Thanks,


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 19, 2019
danilo_fme wrote:

Hello,

Please, check the image bellow. The point is not touching the line:

 

Thanks,

Yes, but I think that with the "Point tolerance" parameters set to 1 meters (for this example) this isn't suppose to be a problem.

I also try to snap the point on the line and rerun the workspace and the result is still the same.


arnovananrooij
Contributor
Forum|alt.badge.img+5
  • Contributor
  • Best Answer
  • February 20, 2019

Hi @julien_m,

This is quit a hard one. I tried putting it together myself. I think the result should be 21 lines and 2 overlaps which makes it 23 together. In your drwaing you forgot to count 2 lines. I my workspace I end up with 24 lines so there is one to many, but I could not figure out how to solve that one. Maybe you could have a look at what I tried to do with the chopper and the matcher to find the double lines.

split2waylineswithpoints.fmw


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • February 20, 2019
julien_m wrote:

Yes, but I think that with the "Point tolerance" parameters set to 1 meters (for this example) this isn't suppose to be a problem.

I also try to snap the point on the line and rerun the workspace and the result is still the same.

I think this is a deficiency in the point on line overlayer as even with a mocked up line with exact matching coordinates the line is not split correctly.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • February 20, 2019

I have a workflow I built for a similar issue, and it seems to work for your data, but it's never been tested in anger. It also relies on there being a vertex in the line that is close to the point you want to chop with and some questionable python

chop_at_index.fmwt


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 20, 2019
ebygomm wrote:

I think this is a deficiency in the point on line overlayer as even with a mocked up line with exact matching coordinates the line is not split correctly.

I think too :(


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 20, 2019
ebygomm wrote:

I have a workflow I built for a similar issue, and it seems to work for your data, but it's never been tested in anger. It also relies on there being a vertex in the line that is close to the point you want to chop with and some questionable python

chop_at_index.fmwt

Thank you very much, I will try this.

Could you take a picture of your workbench. I use FME 2017 and there are some transformers in problem with my version when I open your template.

Thank you :)


julien_m
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 20, 2019
arnovananrooij wrote:

Hi @julien_m,

This is quit a hard one. I tried putting it together myself. I think the result should be 21 lines and 2 overlaps which makes it 23 together. In your drwaing you forgot to count 2 lines. I my workspace I end up with 24 lines so there is one to many, but I could not figure out how to solve that one. Maybe you could have a look at what I tried to do with the chopper and the matcher to find the double lines.

split2waylineswithpoints.fmw

Thank you @arnovananrooij,

This works pretty well. With my FME 2017 version, I end up with 29 lines. I discover that some very small lines appear near from my points. Il will try to find why.

For the moment, this is the closest solution to what I want.

Thank you


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings