Class GeometryCoordinateTransform

java.lang.Object
org.apache.sis.internal.feature.jts.GeometryTransform
org.apache.sis.internal.feature.jts.GeometryCoordinateTransform

final class GeometryCoordinateTransform extends GeometryTransform
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 Details

    • transform

      private final org.opengis.referencing.operation.MathTransform transform
      The transform to apply on coordinate values.
    • coordinates

      private double[] coordinates
      A 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 to MathTransform.transform(double[], int, double[], int, int).
      Specified by:
      transform in class GeometryTransform
      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.