I needed to upgrade our jts.jar from the 1.8 version to 1.10.

I tried using the PreparedGeometry/PreparePolygon classes to see if
there was any noticable change in performance, but the numbers looked
about the same for each run.

The problem I think I'm starting to run into tho, is I am not
encountering more overhead from the profiling tool, than I am gaining
from the code optimizations, so I'm no longer getting completely
accurate timing results. For instance it takes about 45 seconds for the
routine to run while being profiles, and about 2 seconds to run

I think we may need to alter our design approach in order to gain some
more performance. From what I've been reading about the Geometry class,
I'm thinking instead of maintaining four different layers, that we could
use the Geometry's setUserData() method to store our 'cost' values for
the layer and merge all polygon's as geometry objects, into one index.
Maybe the prepared geometry approach would work better with that?

Not sure, very new to JTS at this point :)

-----Original Message-----

As you have now experienced, the biggest speedup you will find comes
from using spatial indexes.

You may also find that using PreparedGeometry helps to reduce the time
even further, since it avoids recomputing topology for the input
polygons.  To do this, store a PreparedGeometry in the spatial index,
rather than the original Polygons.

Please let the list know how this works out if you try it - this is
potentially of interest to lots of people.


jts-devel mailing list

Reply via email to