Class OrientationTransformer

java.lang.Object
org.locationtech.jts.io.geojson.OrientationTransformer

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.locationtech.jts.geom.Geometry
    transformCCW(org.locationtech.jts.geom.Geometry geometry)
    Transforms a geometry using the Right Hand Rule specifications defined in the latest GeoJSON specification.
    static org.locationtech.jts.geom.LinearRing
    transformCCW(org.locationtech.jts.geom.LinearRing ring, boolean isExteriorRing)
    Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification.
    static org.locationtech.jts.geom.Polygon
    transformCCW(org.locationtech.jts.geom.Polygon polygon)
    Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OrientationTransformer

      public OrientationTransformer()
  • Method Details

    • transformCCW

      public static org.locationtech.jts.geom.Geometry transformCCW(org.locationtech.jts.geom.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 org.locationtech.jts.geom.Polygon transformCCW(org.locationtech.jts.geom.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 org.locationtech.jts.geom.LinearRing transformCCW(org.locationtech.jts.geom.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