[geos-devel] split self-intersecting LineString into non-intersecting lines

Sanak geosanak at gmail.com
Wed Apr 22 09:17:04 EDT 2009


Hi Quentin,

"Union" method will split self-intersection linestring.

[Input]
A:LINESTRING(0 0, 100 100, 0 100, 100 0)
B:POINT(0 0)
- B is a one node of A.

Result = A.Union(B)

[Output]
Result:MULTILINESTRING ((0 0, 50 50), (50 50, 100 100, 0 100, 50 50), (50
50, 100 0))

Refer to the document "FOSS4G 2007 : Secrets of the JTS Topology Suite"
(http://www.foss4g2007.org/presentations/view.php?abstract_id=115 )
for details.

Regards,

Sanak.

2009/4/21 Quentin VUILLIOT <q.vuilliot at gmail.com>

> Hello everyone,
>
> I'm not sure this is the right place to post such a question, but I
> can't find any other Geos mailing-list or forum. So please excuse me
> if I'm wrong here.
>
> I can't find a way of splitting a linestring that intersects itself
> into several linestrings that don't. I'm surprised not to find any
> clues about that on the web, though it seems to me that it should be a
> rather common problem, isn't it?
> I mean, there is a function to determine whether a linestring is
> simple or not, but nothing to do more with it, like locate the
> intersection points?
>
> Thank you in advance for your answers
>
> Quentin
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20090422/e48377c3/attachment.html


More information about the geos-devel mailing list