c

org.locationtech.jts.geom.util

GeometryTransformer

class GeometryTransformer extends AnyRef

A framework for processes which transform an input {link Geometry} into an output {link Geometry}, possibly changing its structure and type(s). This class is a framework for implementing subclasses which perform transformations on various different Geometry subclasses. It provides an easy way of applying specific transformations to given geometry types, while allowing unhandled types to be simply copied. Also, the framework ensures that if subcomponents change type the parent geometries types change appropriately to maintain valid structure. Subclasses will override whichever transformX methods they need to to handle particular Geometry types.

A typically usage would be a transformation class that transforms Polygons into Polygons, LineStrings or Points, depending on the geometry of the input (For instance, a simplification operation). This class would likely need to override the {link #transformMultiPolygon(MultiPolygon, Geometry)} method to ensure that if input Polygons change type the result is a GeometryCollection, not a MultiPolygon.

The default behaviour of this class is simply to recursively transform each Geometry component into an identical object by deep copying down to the level of, but not including, coordinates.

All transformX methods may return null, to avoid creating empty or invalid geometry objects. This will be handled correctly by the transformer. transformXXX methods should always return valid geometry - if they cannot do this they should return null (for instance, it may not be possible for a transformLineString implementation to return at least two points - in this case, it should return null). The {link #transform(Geometry)} method itself will always return a non-null Geometry object (but this may be empty).

Version

1.7

See also

GeometryEditor

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GeometryTransformer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GeometryTransformer()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def copy(seq: CoordinateSequence): CoordinateSequence

    Convenience method which provides a standard way of copying {link CoordinateSequence}s

    Convenience method which provides a standard way of copying {link CoordinateSequence}s

    seq

    the sequence to copy return a deep copy of the sequence

    Attributes
    protected
  7. final def createCoordinateSequence(coords: Array[Coordinate]): CoordinateSequence

    Convenience method which provides standard way of creating a {link CoordinateSequence}

    Convenience method which provides standard way of creating a {link CoordinateSequence}

    coords

    the coordinate array to copy return a coordinate sequence for the array

    Attributes
    protected
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. var factory: GeometryFactory
    Attributes
    protected
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def getInputGeometry: Geometry

    Utility function to make input geometry available

    Utility function to make input geometry available

    return the input geometry

  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def transform(inputGeom: Geometry): Geometry
  22. def transformCoordinates(coords: CoordinateSequence, parent: Geometry): CoordinateSequence
    Attributes
    protected
  23. def transformGeometryCollection(geom: GeometryCollection, parent: Geometry): Geometry
    Attributes
    protected
  24. def transformLineString(geom: LineString, parent: Geometry): LineString

    Transforms a {link LineString} geometry.

    Transforms a {link LineString} geometry.

    parent

    return

    Attributes
    protected
  25. def transformLinearRing(geom: LinearRing, parent: Geometry): Geometry
    Attributes
    protected
  26. def transformMultiLineString(geom: MultiLineString, parent: Geometry): Geometry
    Attributes
    protected
  27. def transformMultiPoint(geom: MultiPoint, parent: Geometry): Geometry
    Attributes
    protected
  28. def transformMultiPolygon(geom: MultiPolygon, parent: Geometry): Geometry
    Attributes
    protected
  29. def transformPoint(geom: Point, parent: Geometry): Point
    Attributes
    protected
  30. def transformPolygon(geom: Polygon, parent: Geometry): Geometry
    Attributes
    protected
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped