Package org.meteoinfo.jts.geom.prep
Class PreparedPolygon
- java.lang.Object
-
- org.meteoinfo.jts.geom.prep.PreparedPolygon
-
- All Implemented Interfaces:
PreparedGeometry
public class PreparedPolygon extends java.lang.ObjectA prepared version forPolygonalgeometries. This class supports bothPolygons andMultiPolygons.This class does not support MultiPolygons which are non-valid (e.g. with overlapping elements).
Instances of this class are thread-safe and immutable.
-
-
Constructor Summary
Constructors Constructor Description PreparedPolygon(Polygonal poly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Geometry g)Default implementation.booleancontainsProperly(Geometry g)Default implementation.booleancoveredBy(Geometry g)Default implementation.booleancovers(Geometry g)Default implementation.booleancrosses(Geometry g)Default implementation.booleandisjoint(Geometry g)Standard implementation for all geometries.protected booleanenvelopeCovers(Geometry g)Determines whether the envelope of this geometry covers the Geometry g.protected booleanenvelopesIntersect(Geometry g)Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes.GeometrygetGeometry()Gets the originalGeometrywhich has been prepared.FastSegmentSetIntersectionFindergetIntersectionFinder()Gets the indexed intersection finder for this geometry.PointOnGeometryLocatorgetPointLocator()java.util.ListgetRepresentativePoints()Gets the list of representative points for this geometry.booleanintersects(Geometry g)Default implementation.booleanisAnyTargetComponentInTest(Geometry testGeom)Tests whether any representative of the target geometry intersects the test geometry.booleanoverlaps(Geometry g)Default implementation.java.lang.StringtoString()booleantouches(Geometry g)Default implementation.booleanwithin(Geometry g)Default implementation.
-
-
-
Constructor Detail
-
PreparedPolygon
public PreparedPolygon(Polygonal poly)
-
-
Method Detail
-
getIntersectionFinder
public FastSegmentSetIntersectionFinder getIntersectionFinder()
Gets the indexed intersection finder for this geometry.- Returns:
- the intersection finder
-
getPointLocator
public PointOnGeometryLocator getPointLocator()
-
intersects
public boolean intersects(Geometry g)
Default implementation.- Specified by:
intersectsin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry intersects the given Geometry
- See Also:
Geometry.intersects(Geometry)
-
contains
public boolean contains(Geometry g)
Default implementation.- Specified by:
containsin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry contains the given Geometry
- See Also:
Geometry.contains(Geometry)
-
containsProperly
public boolean containsProperly(Geometry g)
Default implementation.- Specified by:
containsProperlyin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry properly contains the given Geometry
- See Also:
Geometry.contains(org.meteoinfo.jts.geom.Geometry)
-
covers
public boolean covers(Geometry g)
Default implementation.- Specified by:
coversin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry covers the given Geometry
- See Also:
Geometry.covers(Geometry)
-
getGeometry
public Geometry getGeometry()
Description copied from interface:PreparedGeometryGets the originalGeometrywhich has been prepared.- Specified by:
getGeometryin interfacePreparedGeometry- Returns:
- the base geometry
-
getRepresentativePoints
public java.util.List getRepresentativePoints()
Gets the list of representative points for this geometry. One vertex is included for every component of the geometry (i.e. including one for every ring of polygonal geometries). Do not modify the returned list!- Returns:
- a List of Coordinate
-
isAnyTargetComponentInTest
public boolean isAnyTargetComponentInTest(Geometry testGeom)
Tests whether any representative of the target geometry intersects the test geometry. This is useful in A/A, A/L, A/P, L/P, and P/P cases.- Parameters:
geom- the test geometryrepPts- the representative points of the target geometry- Returns:
- true if any component intersects the areal test geometry
-
envelopesIntersect
protected boolean envelopesIntersect(Geometry g)
Determines whether a Geometry g interacts with this geometry by testing the geometry envelopes.- Parameters:
g- a Geometry- Returns:
- true if the envelopes intersect
-
envelopeCovers
protected boolean envelopeCovers(Geometry g)
Determines whether the envelope of this geometry covers the Geometry g.- Parameters:
g- a Geometry- Returns:
- true if g is contained in this envelope
-
coveredBy
public boolean coveredBy(Geometry g)
Default implementation.- Specified by:
coveredByin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry is covered by the given Geometry
- See Also:
Geometry.coveredBy(Geometry)
-
crosses
public boolean crosses(Geometry g)
Default implementation.- Specified by:
crossesin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry crosses the given Geometry
- See Also:
Geometry.crosses(Geometry)
-
disjoint
public boolean disjoint(Geometry g)
Standard implementation for all geometries. SupportsGeometryCollections as input.- Specified by:
disjointin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry is disjoint from the given Geometry
- See Also:
Geometry.disjoint(Geometry)
-
overlaps
public boolean overlaps(Geometry g)
Default implementation.- Specified by:
overlapsin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry overlaps the given Geometry
- See Also:
Geometry.overlaps(Geometry)
-
touches
public boolean touches(Geometry g)
Default implementation.- Specified by:
touchesin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry touches the given Geometry
- See Also:
Geometry.touches(Geometry)
-
within
public boolean within(Geometry g)
Default implementation.- Specified by:
withinin interfacePreparedGeometry- Parameters:
g- the Geometry to test- Returns:
- true if this Geometry is within the given Geometry
- See Also:
Geometry.within(Geometry)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-