Class AbstractGeometryProcessor
java.lang.Object
com.vividsolutions.jump.geom.AbstractGeometryProcessor
- Direct Known Subclasses:
RemoveSmallSegments
An implementation of GeometryProcessor that implements a method to
recursively process GeometryCollections, and that let the user redefine
one or all of the methods to process simple geometries.
By default, simple geometries are added to the result, and the source
geometry is returned unchanged except that it is returned with its
simplest possible representation (ex. if the source geometry has nested
GeometryCollections, it will return a GeometryCollection containing
only simple components.
You can use this class to simply filter geometries (ex. eliminating
dimension 0 or dimension 1 components by not adding them to the list,
or to process some types of geometries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]process(double[] dd) Method to change each single coordinate of a Geometry - ex. coord transformation.voidprocess(org.locationtech.jts.geom.CoordinateSequence sequence) Method to change CoordinateSequences of a geometry - ex. simplifiers.org.locationtech.jts.geom.Geometryprocess(org.locationtech.jts.geom.Geometry geometry) Main method taking an input geometry and returning a new Geometry which may have different properties.org.locationtech.jts.geom.LinearRingprocess(org.locationtech.jts.geom.LinearRing linearRing) Method to process LinearRings.voidprocess(org.locationtech.jts.geom.LineString lineString, List<org.locationtech.jts.geom.Geometry> list) Method to process LineStrings.voidMethod to process Points.voidMethod to process Polygons.
-
Constructor Details
-
AbstractGeometryProcessor
public AbstractGeometryProcessor()
-
-
Method Details
-
process
public org.locationtech.jts.geom.Geometry process(org.locationtech.jts.geom.Geometry geometry) Main method taking an input geometry and returning a new Geometry which may have different properties.- Parameters:
geometry- the Geometry to process- Returns:
- a new Geometry
-
process
public void process(org.locationtech.jts.geom.Point point, List<org.locationtech.jts.geom.Geometry> list) Method to process Points. Override this method to transform punctal elements).- Parameters:
point- input Pointlist- the list accumulating all processed simple component.
-
process
public void process(org.locationtech.jts.geom.LineString lineString, List<org.locationtech.jts.geom.Geometry> list) Method to process LineStrings. Override this method to transform linear elements).- Parameters:
lineString- input LineStringlist- the list accumulating all processed simple component.
-
process
public org.locationtech.jts.geom.LinearRing process(org.locationtech.jts.geom.LinearRing linearRing) Method to process LinearRings.- Parameters:
linearRing- input LinearRing- Returns:
- a new processed LinearRing
-
process
public void process(org.locationtech.jts.geom.Polygon polygon, List<org.locationtech.jts.geom.Geometry> list) Method to process Polygons. Override this method to transform areal elements).- Parameters:
polygon- input Polygonlist- the list accumulating all processed simple component.
-
process
public void process(org.locationtech.jts.geom.CoordinateSequence sequence) Method to change CoordinateSequences of a geometry - ex. simplifiers.- Parameters:
sequence- the CoordinateSequence to process
-
process
public double[] process(double[] dd) Method to change each single coordinate of a Geometry - ex. coord transformation.- Parameters:
dd- the input Coordinate- Returns:
- the transformed Coordinate
-