Aklakan commented on PR #3577:
URL: https://github.com/apache/jena/pull/3577#issuecomment-3521971915
In principle it looks good.
What bothers me is more fundamentally whether the `CustomCoordinateSequence`
is actually needed instead of just reusing the existing
`CoordinateArraySequence`.
But this can be handled as a separate consolidation task in the future.
The custom implementation stores the coordinates in separate primitive
double arrays - whereas the jts one uses a plain List<Coordinate>. The custom
implementation re-creates coordinate objects on access - whereas the default
implementation just serves the objects as-is. The custom implementation is
arguably more memory efficient but it won't evolve with any changes in JTS.
Also, JTS has multiple types of Coordinates: Coordinate, CoordinateXY,
CoordinateXYM, CoordinateXYZM - not all variants are reflected in the current
CustomCoordinateSequence.
The following methods prevent swapping CustomCoordinateSequence for a
standard CoordinateArraySequence - they look like they could just go to static
util functions:
```
public CustomCoordinateSequence();
public CustomCoordinateSequence(double[] x, double[] y, double[] z,
double[] m);
public CustomCoordinateSequence copy();
public static final CustomCoordinateSequence createPoint(double x,
double y);
public CustomCoordinateSequence(CoordinateSequenceDimensions dimensions);
public CustomCoordinateSequence(CoordinateSequenceDimensions dimensions,
String sequence);
public CustomCoordinateSequence(CoordinateSequenceDimensions dimensions,
List<Coordinate> sequence);
public String getCoordinateText(int index);
public int getSize();
public static final CoordinateSequenceDimensions
findCoordinateSequenceDimensions(int coordinateDimension, int spatialDimension);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]