Class VWSimplifier.VWTransformer

    • Field Detail

      • isEnsureValidTopology

        private boolean isEnsureValidTopology
      • distanceTolerance

        private double distanceTolerance
    • Constructor Detail

      • VWTransformer

        public VWTransformer​(boolean isEnsureValidTopology,
                             double distanceTolerance)
    • Method Detail

      • transformCoordinates

        protected CoordinateSequence transformCoordinates​(CoordinateSequence coords,
                                                          Geometry parent)
        Description copied from class: GeometryTransformer
        Transforms a CoordinateSequence. This method should always return a valid coordinate list for the desired result type. (E.g. a coordinate list for a LineString must have 0 or at least 2 points). If this is not possible, return an empty sequence - this will be pruned out.
        Overrides:
        transformCoordinates in class GeometryTransformer
        Parameters:
        coords - the coordinates to transform
        parent - the parent geometry
        Returns:
        the transformed coordinates
      • transformLinearRing

        protected Geometry transformLinearRing​(LinearRing geom,
                                               Geometry parent)
        Simplifies a LinearRing. If the simplification results in a degenerate ring, remove the component.
        Overrides:
        transformLinearRing in class GeometryTransformer
        Parameters:
        geom - the ring to simplify
        parent - the parent geometry
        Returns:
        null if the simplification results in a degenerate ring
      • createValidArea

        private Geometry createValidArea​(Geometry rawAreaGeom)
        Creates a valid area geometry from one that possibly has bad topology (i.e. self-intersections). Since buffer can handle invalid topology, but always returns valid geometry, constructing a 0-width buffer "corrects" the topology. Note this only works for area geometries, since buffer always returns areas. This also may return empty geometries, if the input has no actual area.
        Parameters:
        rawAreaGeom - an area geometry possibly containing self-intersections
        Returns:
        a valid area geometry