Difference (and overlay operations in general) are some of the more
expensive operations in JTS.  That said, they been optimized to the
abilities of (my) current knowledge.  It's possible there are faster
overlay algorithms available, but all the ones I am aware of are
significant work to implement. You might try looking at some of the other
libraries here:

http://tsusiatsoftware.net/jts/jts-links.html#other_apis

Please post back if you try one of them and they are significantly faster.

You can also post an example WKT dataset that shows the performance
question - perhaps there is some data-related improvement that is
possible.  In particular, it's unlikely there is any improvement possible
due to "very small differences", but perhaps the data will reveal
something.

Re "very small differences" do you mean that due to the clipping there is a
large amount of shared linework between the geometries being differenced?

On Tue, Nov 11, 2014 at 6:22 PM, Mart <[email protected]> wrote:

>  Hi all,
>
> I'm working on a project where I need to iteratively buffer a
> source geometry, clip it to another very complex geometry, and produce a
> series of geometries representing the difference between each iteration. It
> is simulating flow of water through a stream network.
>
> The only way I can think of to produce each band is to use
> currentGeometry.difference(previousGeometry).
>
> This works ok but 99% of the processing time is taken up doing the
> difference calculations.
>
> Considering there is typically only a very small difference between
> currentGeometry and previousGeometry I'm wondering whether there is a more
> efficient way of calculating the difference.
>
> I suspect the performance problem might be something to do with garbage
> collection as it typically processes 1-4 iterations very quickly, then
> spends a couple of minutes caught on a call to the difference method. A
> couple of minutes on garbage collection seems a bit excessive but it's got
> a 30GB heap. Are there known issues with the performance of difference or
> is it just a notoriously inefficient operation to perform?
>
> Thanks for any insight.
> Mart
>
>
> ------------------------------------------------------------------------------
> 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://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> 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://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to