Question

Creating straight lines from randomely curved lines


Userlevel 2
Badge +5

I created this line from a set of (X;Y) values of points : 

I’m trying to turn the lines straight and then buffer them to have a result like this: 

Is that even possible ?

 i tried using Bufferer directly then Generalizer , but the result is not good : 

Any Insight is much appreciated !


10 replies

Userlevel 4
Badge +13

You probably will want to use the Generalizer before the Bufferer.

Is this all one line/one feature?

Userlevel 2
Badge +5

@liamfez  thanks for the reply !

Yes it is all one line , I used Generelizer before the Bufferer and the result has impoved , but still not perfect : 

I am hoping to have a clean result like the one i shared 

Userlevel 4
Badge +13

You could try the TopologyBuilder before the Generalizer. Working with that whole thing as one line would be difficult. Once you have each segment between intersections as their own line, you should be able to increase the settings on the Generalizer. It may take some playing around with when it comes to finding the right Generalizer settings, but it seems like you want pretty straight lines between intersections. In which case, you don’t really need all the vertices between intersections so getting rid of them will probably help clean things up. It also looks like you might have some odd standalone points getting buffered, you may want to try a GeometryFilter before you buffer that way you are only buffering lines

Userlevel 2
Badge +5

 

@liamfez the result has improved , but some problems still exist .

for exemple those horizontal lines are meant to belong to the same straight line .

and those arrows i drawn is how the lines are meant to be : 

and to give more context , here is what my points looked like before i extracted the centerline : 

maybe there is an alternative solution , other than creating the centerline first

Userlevel 4
Badge +13

I am not sure if you can fix all of those issues identified without some manual review and modification in a GIS software.
Are you buffering the points a small amount, dissolving, and extracting the centerlines from that?

Userlevel 2
Badge +5

Are you buffering the points a small amount, dissolving, and extracting the centerlines from that?

@liamfez  Yes that is what i did

Userlevel 4
Badge +13

Are you able to provide a copy of the workspace, or at least this section of the workspace?

Userlevel 2
Badge +5

@liamfez 

Sure , here is the workspace, as well as my input file : 

 

Userlevel 4
Badge +13

I played around with it for a little while and unfortunately have not really come up with any easy way to get your desired results. You could try adjusting the buffer and generalizing settings to fine tune the results a bit more (trial and error to your liking), but other than that I am at a bit of a loss (short of manual adjustment in a GIS program).

Sorry

Userlevel 2
Badge +5

@liamfez Thanks for you help ! I guess manual adjustments is the only way :)

Reply