Package org.locationtech.jts.io.geojson
Class OrientationTransformer
java.lang.Object
org.locationtech.jts.io.geojson.OrientationTransformer
Utilities to modify the ring orientation of polygonal geometries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Geometry
transformCCW
(Geometry geometry) Transforms a geometry using the Right Hand Rule specifications defined in the latest GeoJSON specification.static LinearRing
transformCCW
(LinearRing ring, boolean isExteriorRing) Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification.static Polygon
transformCCW
(Polygon polygon) Transforms a polygon using the Right Hand Rule specifications defined in the latest GeoJSON specification.
-
Constructor Details
-
OrientationTransformer
public OrientationTransformer()
-
-
Method Details
-
transformCCW
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
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
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 PolygonsisExteriorRing
- true if the LinearRing is the exterior polygon ring, the one that defines the boundary- Returns:
- LinearRing under the Right Hand Rule specifications
-