Class OrientationTransformer


  • public class OrientationTransformer
    extends Object
    Utilities to modify the ring orientation of polygonal geometries.
    • Constructor Detail

      • OrientationTransformer

        public OrientationTransformer()
    • Method Detail

      • transformCCW

        public static Geometry transformCCW​(Geometry geometry)
        Transforms a geometry using the Right Hand Rule specifications defined in the latest GeoJSON specification. See RFC-7946 Specification for more context.
        Parameters:
        geometry - to be transformed
        Returns:
        Geometry under the Right Hand Rule specifications
      • transformCCW

        public static Polygon transformCCW​(Polygon polygon)
        Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification. See RFC-7946 Specification for more context.
        Parameters:
        polygon - to be transformed
        Returns:
        Polygon under the Right Hand Rule specifications
      • transformCCW

        public static LinearRing transformCCW​(LinearRing ring,
                                              boolean isExteriorRing)
        Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification. A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise. See RFC 7946 Specification for more context.
        Parameters:
        ring - the LinearRing, a constraint specific to Polygons
        isExteriorRing - true if the LinearRing is the exterior polygon ring, the one that defines the boundary
        Returns:
        LinearRing under the Right Hand Rule specifications