Class GeometryCoordinateTransform
java.lang.Object
org.apache.sis.internal.feature.jts.GeometryTransform
org.apache.sis.internal.feature.jts.GeometryCoordinateTransform
A geometry transformer which uses a
MathTransform
for changing coordinate values.
This class does not change the number of points.
This class is not thread-safe.- Since:
- 1.0
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[]
A temporary buffer holding coordinates to transform.private final org.opengis.referencing.operation.MathTransform
The transform to apply on coordinate values.Fields inherited from class org.apache.sis.internal.feature.jts.GeometryTransform
coordinateFactory
-
Constructor Summary
ConstructorsConstructorDescriptionGeometryCoordinateTransform
(org.opengis.referencing.operation.MathTransform transform, org.locationtech.jts.geom.GeometryFactory factory) Creates a new geometry transformer using the given coordinate transform. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.locationtech.jts.geom.CoordinateSequence
transform
(org.locationtech.jts.geom.CoordinateSequence sequence, int minPoints) Transforms the given sequence of coordinate tuples, producing a new sequence of tuples.
-
Field Details
-
transform
private final org.opengis.referencing.operation.MathTransform transformThe transform to apply on coordinate values. -
coordinates
private double[] coordinatesA temporary buffer holding coordinates to transform. Created when first needed in order to have an estimation of size needed.
-
-
Constructor Details
-
GeometryCoordinateTransform
GeometryCoordinateTransform(org.opengis.referencing.operation.MathTransform transform, org.locationtech.jts.geom.GeometryFactory factory) Creates a new geometry transformer using the given coordinate transform. It is caller's responsibility to ensure that the number of source and target dimensions of the given transform are equal to the number of dimensions of the geometries to transform.- Parameters:
transform
- the transform to apply on coordinate values.factory
- the factory to use for creating geometries. Shall not be null.
-
-
Method Details
-
transform
protected org.locationtech.jts.geom.CoordinateSequence transform(org.locationtech.jts.geom.CoordinateSequence sequence, int minPoints) throws org.opengis.referencing.operation.TransformException Transforms the given sequence of coordinate tuples, producing a new sequence of tuples. This method tries to transform coordinates in batches, in order to reduce the amount of calls toMathTransform.transform(double[], int, double[], int, int)
.- Specified by:
transform
in classGeometryTransform
- Parameters:
sequence
- sequence of coordinate tuples to transform.minPoints
- minimum number of points to preserve.- Returns:
- the transformed sequence of coordinate tuples.
- Throws:
org.opengis.referencing.operation.TransformException
- if an error occurred while transforming a tuple.
-