[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Extending line segments
From:       Hemant Bist <hemantbist () gmail ! com>
Date:       2018-08-27 19:47:11
Message-ID: CAHgSXQ=5o3vd3yBXg=ZcHG1JQw6=xTbQmwe7s4F7TZDsG8+LJA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks,
(I am trying to get permission to send the data).  I have n't tried
st_Straightskeleton. Will try it....


On Mon, Aug 27, 2018 at 11:07 AM, Darafei "Kom=D1=8Fpa" Praliaskouski <
me@komzpa.net> wrote:

> 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?
>
> =D0=BF=D0=BD, 27 =D0=B0=D0=B2=D0=B3. 2018 =D0=B3. =D0=B2 19:34, Hemant Bi=
st <hemantbist@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 dat=
a
>> (linstrings) they have a small gap.
>> 2) The vector lines (multiple linestrings) are dashed line representatio=
n
>> 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 joine=
d
>> 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_un=
ion.
>>
>> If there are something available in other tools like gdal, grass,  I wil=
l
>> be happy to look at them. Currently I don't know of any solutions in oth=
er
>> tools as well.
>> Thanks,
>> HB
>>
>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
> --
> Darafei Praliaskouski
> Support me: http://patreon.com/komzpa
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>Thanks,</div><div>(I am trying to get permission to send the \
data).   I have n&#39;t tried st_Straightskeleton. Will try \
it....</div><div><br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Mon, Aug 27, 2018 at 11:07 AM, Darafei &quot;Komяpa&quot; \
Praliaskouski <span dir="ltr">&lt;<a href="mailto:me@komzpa.net" \
target="_blank">me@komzpa.net</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi!<div><br></div><div>First case sounds like \
ST_Snap.  </div><div><br></div><div>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.</div><div><br></div><div>Can you \
share a dataset to play with?  </div></div><br><div class="gmail_quote"><div \
dir="ltr">пн, 27 авг. 2018 г. в 19:34, Hemant Bist &lt;<a \
href="mailto:hemantbist@gmail.com" \
target="_blank">hemantbist@gmail.com</a>&gt;:<br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,  <div>Is there \
something already written that can help me do the \
following?</div><div><br></div><div>I need to &quot;extend&quot; the line segments   \
by a small amount to see if they can be joined.   The use cases are  </div><div>1) \
Joining line segments that should be joined in reality but in the data (linstrings) \
they have a small gap.</div><div>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.</div><div>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  </div><div><br></div><div>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.</div><div>The other drawback of st_buffer is \
that it extends line in all directions, instead of extending line segments in \
expected directions.</div><div><br></div><div>Currently   the only   possible \
&quot;solution&quot; I have in mind is to write something custom to extend the \
individual line strings and then do st_union.<br></div><div><br></div><div>If there \
are something available in other tools like gdal, grass,   I will be happy to look at \
them. Currently I don&#39;t know of any solutions in other tools as \
well.</div><div>Thanks,</div><div>HB</div><div><br></div><div><br></div><div><br></div><div> \
</div></div></div></div> ______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" \
target="_blank">postgis-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></blockquote></div><span \
class="HOEnZb"><font color="#888888">-- <br><div dir="ltr" \
class="m_8377774771025265130gmail_signature" data-smartmail="gmail_signature"><div \
dir="ltr">Darafei Praliaskouski<br>Support me: <a href="http://patreon.com/komzpa" \
target="_blank">http://patreon.com/komzpa</a></div></div> \
</font></span><br>______________________________<wbr>_________________<br> \
postgis-users mailing list<br> <a \
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br> <a \
href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" \
target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>



[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic