[postgis-users] Extending line segments
hemantbist at gmail.com
Mon Aug 27 09:34:20 PDT 2018
Is there something already written that can help me do the following?
I need to "extend" the line segments by a small amount to see if they can
be joined. The use cases are
1) Joining line segments that should be joined in reality but in the data
(linstrings) they have a small gap.
2) The vector lines (multiple linestrings) are dashed line representation
of real line .e.g. representing a road by dashed line of 4mm dashes with
gap of 1 mm between them.
I am willing to live with error cases where some line segments are joined
when they should not be. The output I need should be
I cannot do st_buffer(st_union(st_buffer( line_geometry, epsilon)),
-epsilon) as it turns the lines into area. But visually these areas look
close to what I need.
The other drawback of st_buffer is that it extends line in all directions,
instead of extending line segments in expected directions.
Currently the only possible "solution" I have in mind is to write
something custom to extend the individual line strings and then do st_union.
If there are something available in other tools like gdal, grass, I will
be happy to look at them. Currently I don't know of any solutions in other
tools as well.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-users