Package org.geotools.coverage.util
Class IntersectUtils
Object
IntersectUtils
Performs some naive intersections on GeometryCollections, because JTS is not supporting them.
- Author:
- Emanuele Tajariol (GeoSolutions)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Geometryintersection(Geometry g1, Geometry g2) Return the intersection of two Geometries.static booleanintersects(Geometry g1, Geometry g2) Tests whether the two geometries intersect.static GeometryunrollGeometries(Geometry geometry) Flatten all first-level (i.e. non recursively) bundles (GeometryCollections and MultiPolygons) into a GeometryCollection.
-
Constructor Details
-
IntersectUtils
public IntersectUtils()
-
-
Method Details
-
intersects
Tests whether the two geometries intersect.This method relies completely on
Geometry.intersects(Geometry)but also tries to unroll GeometryCollections.- Returns:
- true if the two geometries intersect.
-
intersection
Return the intersection of two Geometries.
This method relies completely onGeometry.intersection(Geometry)but also tries to unroll GeometryCollections.- Returns:
- true if the two geometries intersect.
-
unrollGeometries
Flatten all first-level (i.e. non recursively) bundles (GeometryCollections and MultiPolygons) into a GeometryCollection.
Valid structures:- null -> null
- Polygon -> Polygon
- MultiPolygon -> GeometryCollection of Polygons
- GeometryCollection holding Polygons and MultiPolygons -> GeometryCollection of Polygons
- Throws:
IllegalArgumentException- when encountering illegal Geometries; message is the Geometry class name.
-