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
- Alphabetic
- By Inheritance
- GeometryTransformer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new GeometryTransformer()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- var factory: GeometryFactory
- Attributes
- protected
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getInputGeometry: Geometry
Utility function to make input geometry available
Utility function to make input geometry available
return the input geometry
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def transform(inputGeom: Geometry): Geometry
- def transformCoordinates(coords: CoordinateSequence, parent: Geometry): CoordinateSequence
- Attributes
- protected
- def transformGeometryCollection(geom: GeometryCollection, parent: Geometry): Geometry
- Attributes
- protected
- def transformLineString(geom: LineString, parent: Geometry): LineString
Transforms a {link LineString} geometry.
Transforms a {link LineString} geometry.
- parent
return
- Attributes
- protected
- def transformLinearRing(geom: LinearRing, parent: Geometry): Geometry
- Attributes
- protected
- def transformMultiLineString(geom: MultiLineString, parent: Geometry): Geometry
- Attributes
- protected
- def transformMultiPoint(geom: MultiPoint, parent: Geometry): Geometry
- Attributes
- protected
- def transformMultiPolygon(geom: MultiPolygon, parent: Geometry): Geometry
- Attributes
- protected
- def transformPoint(geom: Point, parent: Geometry): Point
- Attributes
- protected
- def transformPolygon(geom: Polygon, parent: Geometry): Geometry
- Attributes
- protected
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()