Class GeometryNoder
- java.lang.Object
-
- org.locationtech.jts.noding.snapround.GeometryNoder
-
public class GeometryNoder extends java.lang.Object
Nodes the linework in a list ofGeometry
s using Snap-Rounding to a givenPrecisionModel
.The input coordinates are expected to be rounded to the given precision model. This class does not perform that function.
GeometryPrecisionReducer
may be used to do this.This class does not dissolve the output linework, so there may be duplicate linestrings in the output. Subsequent processing (e.g. polygonization) may require the linework to be unique. Using
UnaryUnion
is one way to do this (although this is an inefficient approach).
-
-
Field Summary
Fields Modifier and Type Field Description private GeometryFactory
geomFact
private boolean
isValidityChecked
private PrecisionModel
pm
-
Constructor Summary
Constructors Constructor Description GeometryNoder(PrecisionModel pm)
Creates a new noder which snap-rounds to a grid specified by the givenPrecisionModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List
extractLines(java.util.Collection geoms)
java.util.List
node(java.util.Collection geoms)
Nodes the linework of a set of Geometrys using SnapRounding.void
setValidate(boolean isValidityChecked)
Sets whether noding validity is checked after noding is performed.private java.util.List
toLineStrings(java.util.Collection segStrings)
private java.util.List
toSegmentStrings(java.util.Collection lines)
-
-
-
Field Detail
-
geomFact
private GeometryFactory geomFact
-
pm
private PrecisionModel pm
-
isValidityChecked
private boolean isValidityChecked
-
-
Constructor Detail
-
GeometryNoder
public GeometryNoder(PrecisionModel pm)
Creates a new noder which snap-rounds to a grid specified by the givenPrecisionModel
.- Parameters:
pm
- the precision model for the grid to snap-round to
-
-
Method Detail
-
setValidate
public void setValidate(boolean isValidityChecked)
Sets whether noding validity is checked after noding is performed.- Parameters:
isValidityChecked
-
-
node
public java.util.List node(java.util.Collection geoms)
Nodes the linework of a set of Geometrys using SnapRounding.- Parameters:
geoms
- a Collection of Geometrys of any type- Returns:
- a List of LineStrings representing the noded linework of the input
-
toLineStrings
private java.util.List toLineStrings(java.util.Collection segStrings)
-
extractLines
private java.util.List extractLines(java.util.Collection geoms)
-
toSegmentStrings
private java.util.List toSegmentStrings(java.util.Collection lines)
-
-