[postgis-users] Extending line segments

Darafei "Komяpa" Praliaskouski me at komzpa.net
Mon Aug 27 11:07:19 PDT 2018


Hi!

First case sounds like ST_Snap.

For second case, if you are not going to write an extending loop I would
try to get the polygon after buffering and then try with
ST_StraightSkeleton and ST_ApproximateMedialAxis.

Can you share a dataset to play with?

пн, 27 авг. 2018 г. в 19:34, Hemant Bist <hemantbist at gmail.com>:

> Hi,
> 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.
> Thanks,
> HB
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users

-- 
Darafei Praliaskouski
Support me: http://patreon.com/komzpa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180827/80e15812/attachment.html>


More information about the postgis-users mailing list