Class PrecisionReducer
- java.lang.Object
-
- org.locationtech.jts.operation.overlayng.PrecisionReducer
-
public class PrecisionReducer extends java.lang.Object
Functions to reduce the precision of a geometry by rounding it to a given precision model.This class handles only polygonal and linear inputs. For full functionality see
GeometryPrecisionReducer
.- Author:
- Martin Davis
- See Also:
GeometryPrecisionReducer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Geometry
reducePrecision(Geometry geom, PrecisionModel pm)
Reduces the precision of a geometry by rounding and snapping it to the suppliedPrecisionModel
.
-
-
-
Method Detail
-
reducePrecision
public static Geometry reducePrecision(Geometry geom, PrecisionModel pm)
Reduces the precision of a geometry by rounding and snapping it to the suppliedPrecisionModel
. The input geometry must be polygonal or linear.The output is always a valid geometry. This implies that input components may be merged if they are closer than the grid precision. if merging is not desired, then the individual geometry components should be processed separately.
The output is fully noded (i.e. coincident lines are merged and noded). This provides an effective way to node / snap-round a collection of
LineString
s.- Parameters:
geom
- the geometry to reducepm
- the precision model to use- Returns:
- the precision-reduced geometry
- Throws:
java.lang.IllegalArgumentException
- if the reduction fails due to invalid input geometry is invalid
-
-