Package org.locationtech.jts.densify
Class Densifier.DensifyTransformer
- java.lang.Object
-
- org.locationtech.jts.geom.util.GeometryTransformer
-
- org.locationtech.jts.densify.Densifier.DensifyTransformer
-
- Enclosing class:
- Densifier
static class Densifier.DensifyTransformer extends GeometryTransformer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) doubledistanceTolerance-
Fields inherited from class org.locationtech.jts.geom.util.GeometryTransformer
factory
-
-
Constructor Summary
Constructors Constructor Description DensifyTransformer(double distanceTolerance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private GeometrycreateValidArea(Geometry roughAreaGeom)Creates a valid area geometry from one that possibly has bad topology (i.e.protected CoordinateSequencetransformCoordinates(CoordinateSequence coords, Geometry parent)Transforms aCoordinateSequence.protected GeometrytransformMultiPolygon(MultiPolygon geom, Geometry parent)protected GeometrytransformPolygon(Polygon geom, Geometry parent)-
Methods inherited from class org.locationtech.jts.geom.util.GeometryTransformer
copy, createCoordinateSequence, getInputGeometry, transform, transformGeometryCollection, transformLinearRing, transformLineString, transformMultiLineString, transformMultiPoint, transformPoint
-
-
-
-
Method Detail
-
transformCoordinates
protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent)
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
protected Geometry transformPolygon(Polygon geom, Geometry parent)
- Overrides:
transformPolygonin classGeometryTransformer
-
transformMultiPolygon
protected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent)
- Overrides:
transformMultiPolygonin classGeometryTransformer
-
createValidArea
private Geometry createValidArea(Geometry roughAreaGeom)
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:
roughAreaGeom- an area geometry possibly containing self-intersections- Returns:
- a valid area geometry
-
-