As you might guess from the name, union() on MultiLineStrings doesn't
actually use CascadedPolygonUnion.  Instead it simply uses the basic
union() on the MultiLineString (with an empty LineString as the other
argument).

The rationale behind this is that CascadedPolygonUnion gets its efficiency
from the fact that typically unioning polygons resutls in discarding
vertice (sometimes very many).  A typical set of LineStrings doesn't
exhibit this behaviour (except in the rare cases where portions of
LineStrings are coincident).

TopologyExceptions I can understand.  This is due to the (still present)
robustness problems of the JTS union algorithm.  CPU doesn't help with this
much, since it uses the same algorithm.   Invalid output is more puzzling,
since the validity criteria for MultiLineStrings are very minimal.   Can
you give an example?

The ultimate solution to this is to create a robust, fast overlay algorithm
- such as this one: http://tsusiatsoftware.net/forse/main.html

As a step towards this, you could potentially create a sweepline-based
union algorithm based on the current JTS union and some (well, quite a bit)
of bookkeeping to remove output linestrings as the sweepline moved past
them.

TLDR: not much improvement can be gained with JTS as it stands.

On Thu, Oct 16, 2014 at 10:34 AM, Rob Emanuele <[email protected]> wrote:

> Hello,
>
> I'm unioning a lot of LineStrings. A couple problems that I'm having is
> that I find it throws TopologyExceptions, can sometimes produce invalid
> MuliLineStrings, and is very slow.
>
> The way I'm doing it is to collect all the LineStrings as a
> MultiLineString and calling the parameter-less `.union()` on the
> MultiLineString.
>
> Is there a better way to do this (a la CascadingPolygonUnion)?
>
> Thanks,
> Rob
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> _______________________________________________
> Jts-topo-suite-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to