Package org.locationtech.jts.simplify
Class VWSimplifier.VWTransformer
java.lang.Object
org.locationtech.jts.geom.util.GeometryTransformer
org.locationtech.jts.simplify.VWSimplifier.VWTransformer
- Enclosing class:
VWSimplifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate booleanFields inherited from class org.locationtech.jts.geom.util.GeometryTransformer
factory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate GeometrycreateValidArea(Geometry rawAreaGeom) Creates a valid area geometry from one that possibly has bad topology (i.e.protected CoordinateSequencetransformCoordinates(CoordinateSequence coords, Geometry parent) Transforms aCoordinateSequence.protected GeometrytransformLinearRing(LinearRing geom, Geometry parent) Simplifies a LinearRing.protected GeometrytransformMultiPolygon(MultiPolygon geom, Geometry parent) Simplifies a MultiPolygon, fixing it if required.protected GeometrytransformPolygon(Polygon geom, Geometry parent) Simplifies a polygon, fixing it if required.Methods inherited from class org.locationtech.jts.geom.util.GeometryTransformer
copy, createCoordinateSequence, getInputGeometry, transform, transformGeometryCollection, transformLineString, transformMultiLineString, transformMultiPoint, transformPoint
-
Field Details
-
isEnsureValidTopology
private boolean isEnsureValidTopology -
distanceTolerance
private double distanceTolerance
-
-
Constructor Details
-
VWTransformer
public VWTransformer(boolean isEnsureValidTopology, double distanceTolerance)
-
-
Method Details
-
transformCoordinates
Description copied from class:GeometryTransformerTransforms aCoordinateSequence. This method should always return a valid coordinate list for the desired result type. (E.g. a coordinate list for a LineString must have 0 or at least 2 points). If this is not possible, return an empty sequence - this will be pruned out.- Overrides:
transformCoordinatesin classGeometryTransformer- Parameters:
coords- the coordinates to transformparent- the parent geometry- Returns:
- the transformed coordinates
-
transformPolygon
Simplifies a polygon, fixing it if required.- Overrides:
transformPolygonin classGeometryTransformer
-
transformLinearRing
Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component.- Overrides:
transformLinearRingin classGeometryTransformer- Parameters:
geom- the ring to simplifyparent- the parent geometry- Returns:
- null if the simplification results in a degenerate ring
-
transformMultiPolygon
Simplifies a MultiPolygon, fixing it if required.- Overrides:
transformMultiPolygonin classGeometryTransformer
-
createValidArea
Creates a valid area geometry from one that possibly has bad topology (i.e. self-intersections). Since buffer can handle invalid topology, but always returns valid geometry, constructing a 0-width buffer "corrects" the topology. Note this only works for area geometries, since buffer always returns areas. This also may return empty geometries, if the input has no actual area.- Parameters:
rawAreaGeom- an area geometry possibly containing self-intersections- Returns:
- a valid area geometry
-