Class GeometryMapper
java.lang.Object
org.locationtech.jts.geom.util.GeometryMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface for geometry functions that map a geometry input to a geometry output. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeometryflatMap(Geometry geom, int emptyDim, GeometryMapper.MapOp op) Maps the atomic elements of aGeometry(which may be atomic or composite) using aGeometryMapper.MapOpmapping operation into an atomic Geometry or a flat collection of the most specific type.static Collectionmap(Collection geoms, GeometryMapper.MapOp op) static Geometrymap(Geometry geom, GeometryMapper.MapOp op) Maps the members of aGeometry(which may be atomic or composite) into another Geometry of most specific type.
-
Constructor Details
-
GeometryMapper
public GeometryMapper()
-
-
Method Details
-
map
Maps the members of aGeometry(which may be atomic or composite) into another Geometry of most specific type. null results are skipped. In the case of hierarchicalGeometryCollections, only the first level of members are mapped.- Parameters:
geom- the input atomic or composite geometryop- the mapping operation- Returns:
- a result collection or geometry of most specific type
-
map
-
flatMap
Maps the atomic elements of aGeometry(which may be atomic or composite) using aGeometryMapper.MapOpmapping operation into an atomic Geometry or a flat collection of the most specific type. null and empty values returned from the mapping operation are discarded.- Parameters:
geom- the geometry to mapemptyDim- the dimension of empty geometry to createop- the mapping operation- Returns:
- the mapped result
-