Class GeometrySnapRounder
- java.lang.Object
-
- org.locationtech.jtslab.snapround.GeometrySnapRounder
-
public class GeometrySnapRounder extends java.lang.ObjectNodes aGeometryusing Snap-Rounding to a givenPrecisionModel.- Point geometries are not handled. They are skipped if present in the input.
- Linestrings which collapse to a point due to snapping are removed.
- Polygonal output may not be valid. Invalid output is due to the introduction of topology collapses. This should be straightforward to clean using standard heuristics (e.g. buffer(0) ).
GeometryPrecisionReducermay be used to do this.
-
-
Constructor Summary
Constructors Constructor Description GeometrySnapRounder(PrecisionModel pm)Creates a new snap-rounder which snap-rounds to a grid specified by the givenPrecisionModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometryexecute(Geometry geom)Snap-rounds the given geometry.voidsetLineworkOnly(boolean isLineworkOnly)
-
-
-
Constructor Detail
-
GeometrySnapRounder
public GeometrySnapRounder(PrecisionModel pm)
Creates a new snap-rounder which snap-rounds to a grid specified by the givenPrecisionModel.- Parameters:
pm- the precision model for the grid to snap-round to
-
-