Question

How to split polyline at point locations

  • 26 July 2021
  • 2 replies
  • 35 views

Hi everyone,

 

I have a polyline shapefile that represents a transport route. I also have a point shapefile of markers along the route. I want to be able to split the polyline into segments between the points. I want to retain the route rather than use line builder to create segments between the points.

 

I have tried using the PointOnLineOverlayer transformer but I end up with significantly more line sections than I am expecting. For example I have a line with 27 markers along it. I am expecting to get 28 segments when I split the line at these points. Instead I am ending up with 61 as the line is split in locations where there is no point (highlighted blue part is on of the output lines). I think this may be a result of the aggregate geometry parameter.

SplitLineAtPoint_SplitAtWrongPlace 

When I run the polyline through the aggregate filter it says the line is an aggregate. I see that the aggregate options in the PointOnLineOverlayer are deaggregate (which I think explains why I get more line segments than I was expecting) or reject. If this could explain why I am getting more lines than expected how can I deal with the aggregate geometry as I don't want to reject my polyline?

 

Thanks :)


2 replies

Userlevel 4
Badge +26

Try putting a LineCombiner before the PointOnLineOverlayer. This should 'clean' the lines and give you back proper lines instead of MultiCurve features.

Userlevel 5
Badge +29

Try putting a LineCombiner before the PointOnLineOverlayer. This should 'clean' the lines and give you back proper lines instead of MultiCurve features.

The PointOnLine will explode aggregate features, hence seeing more lines than expected

Reply