Class GeometrySnapRounder


  • public class GeometrySnapRounder
    extends java.lang.Object
    Nodes a Geometry using Snap-Rounding to a given PrecisionModel.
    • 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) ).
    The input geometry 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.
    • Constructor Detail

      • GeometrySnapRounder

        public GeometrySnapRounder​(PrecisionModel pm)
        Creates a new snap-rounder which snap-rounds to a grid specified by the given PrecisionModel.
        Parameters:
        pm - the precision model for the grid to snap-round to
    • Method Detail

      • setLineworkOnly

        public void setLineworkOnly​(boolean isLineworkOnly)
      • execute

        public Geometry execute​(Geometry geom)
        Snap-rounds the given geometry.
        Parameters:
        geom -
        Returns: