Class GeometryTransform

java.lang.Object
org.apache.sis.internal.feature.jts.GeometryTransform
Direct Known Subclasses:
GeometryCoordinateTransform

public abstract class GeometryTransform extends Object
An operation transforming a geometry into another geometry. This class decomposes the geometry into it's most primitive elements, the CoordinateSequence, applies an operation, then rebuilds the geometry. The operation may change coordinate values (for example a map projection), but not necessarily. An operation could also be a clipping for example.
Since:
1.0
Version:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.locationtech.jts.geom.CoordinateSequenceFactory
    The factory to use for creating sequences of coordinate tuples.
    private final org.locationtech.jts.geom.GeometryFactory
    The factory to use for creating geometries.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    GeometryTransform(org.locationtech.jts.geom.GeometryFactory factory)
    Creates a new operation using the given factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract 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.
    org.locationtech.jts.geom.Geometry
    transform(org.locationtech.jts.geom.Geometry geom)
    Transforms the given geometry.
    org.locationtech.jts.geom.GeometryCollection
    transform(org.locationtech.jts.geom.GeometryCollection geom)
    Transforms the given geometries.
    org.locationtech.jts.geom.LinearRing
    transform(org.locationtech.jts.geom.LinearRing geom)
    Transforms the given linear ring.
    org.locationtech.jts.geom.LineString
    transform(org.locationtech.jts.geom.LineString geom)
    Transforms the given line string.
    org.locationtech.jts.geom.MultiLineString
    transform(org.locationtech.jts.geom.MultiLineString geom)
    Transforms the given line strings.
    org.locationtech.jts.geom.MultiPoint
    transform(org.locationtech.jts.geom.MultiPoint geom)
    Transforms the given points.
    org.locationtech.jts.geom.MultiPolygon
    transform(org.locationtech.jts.geom.MultiPolygon geom)
    Transforms the given polygons.
    org.locationtech.jts.geom.Point
    transform(org.locationtech.jts.geom.Point geom)
    Transforms the given point.
    org.locationtech.jts.geom.Polygon
    transform(org.locationtech.jts.geom.Polygon geom)
    Transforms the given polygon.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • geometryFactory

      private final org.locationtech.jts.geom.GeometryFactory geometryFactory
      The factory to use for creating geometries.
    • coordinateFactory

      protected final org.locationtech.jts.geom.CoordinateSequenceFactory coordinateFactory
      The factory to use for creating sequences of coordinate tuples.
  • Constructor Details

    • GeometryTransform

      protected GeometryTransform(org.locationtech.jts.geom.GeometryFactory factory)
      Creates a new operation using the given factory.
      Parameters:
      factory - the factory to use for creating geometries. Shall not be null.
  • Method Details

    • transform

      public org.locationtech.jts.geom.Geometry transform(org.locationtech.jts.geom.Geometry geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given geometry. This method delegates to one of the transform(…) methods based on the type of the given geometry.
      Parameters:
      geom - the geometry to transform.
      Returns:
      the transformed geometry.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming the geometry.
    • transform

      public org.locationtech.jts.geom.Point transform(org.locationtech.jts.geom.Point geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given point. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the point to transform.
      Returns:
      the transformed point.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming the geometry.
    • transform

      public org.locationtech.jts.geom.MultiPoint transform(org.locationtech.jts.geom.MultiPoint geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given points. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the points to transform.
      Returns:
      the transformed points.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming a geometry.
    • transform

      public org.locationtech.jts.geom.LineString transform(org.locationtech.jts.geom.LineString geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given line string. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the line string to transform.
      Returns:
      the transformed line string.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming the geometry.
    • transform

      public org.locationtech.jts.geom.MultiLineString transform(org.locationtech.jts.geom.MultiLineString geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given line strings. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the line strings to transform.
      Returns:
      the transformed line strings.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming a geometry.
    • transform

      public org.locationtech.jts.geom.LinearRing transform(org.locationtech.jts.geom.LinearRing geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given linear ring. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the linear ring to transform.
      Returns:
      the transformed linear ring.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming the geometry.
    • transform

      public org.locationtech.jts.geom.Polygon transform(org.locationtech.jts.geom.Polygon geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given polygon. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the polygon to transform.
      Returns:
      the transformed polygon.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming the geometry.
    • transform

      public org.locationtech.jts.geom.MultiPolygon transform(org.locationtech.jts.geom.MultiPolygon geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given polygons. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the polygons to transform.
      Returns:
      the transformed polygons.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming a geometry.
    • transform

      public org.locationtech.jts.geom.GeometryCollection transform(org.locationtech.jts.geom.GeometryCollection geom) throws org.opengis.referencing.operation.TransformException
      Transforms the given geometries. Can be invoked directly if the type is known at compile-time, or indirectly through a call to the more generic transform(Geometry) method.
      Parameters:
      geom - the geometries to transform.
      Returns:
      the transformed geometries.
      Throws:
      org.opengis.referencing.operation.TransformException - if an error occurred while transforming a geometry.
    • transform

      protected abstract 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.
      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.