Open dr-jts opened 7 years ago
All usages of org.locationtech.jts.geom.CoordinateArrays
class (here) potentially benefit from a utility class that works on org.locationtech.jts.geom.CoordinateSequence
instead of org.locationtech.jts.geom.Coordinate[]
. This would have to be extended.
Not explicitly performance, but making the [WKT|WKB]Reader
classes not work on org.locationtech.jts.geom.Coordinate[]
can help to improve handling of measure ordinate values. I have an implementation using a CoordinateBuffer
class at hand.
Good recommendations @FObermaier .
What is the nature of your CoordinateBuffer
class?
What is the nature of your
CoordinateBuffer
class?
It encapsulates an ArrayList
to store 3DM coordinate values. You can add ordinate values calling add2d
, add3d
, add2dm
, add3dm
functions. While adding the following is taken care of:
Coordinate.NULL_ORDINATE
CoordinateSequence
using any factorygetXY()
, getZ()
, getM()
)You can have a look at it here.
To improve the performance of using non-array based
CoordinateSequence
implementations the JTS core should be changed to using coordinate access based onCoordinateSequence
accessors, instead of forcing the creation of Coordinate arrays.Some places where this is needed:
PointLocation
isInRing
andlocateInRing
Centroid.add(Polygon)
See also: