public class PreparedPolygon extends AbstractPolygon
Polygonal geometries.
This class supports both Polygons and MultiPolygons.
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 and Description |
|---|
PreparedPolygon(Polygon polygon) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Geometry g)
Tests whether this geometry contains the
argument geometry.
|
boolean |
containsProperly(Geometry geometry) |
boolean |
covers(Geometry geometry)
Tests whether this geometry covers the
argument geometry.
|
BoundingBox |
getBoundingBox()
Gets an
BoundingBoxDoubleGf containing
the minimum and maximum x and y values in this Geometry. |
FastSegmentSetIntersectionFinder |
getIntersectionFinder()
Gets the indexed intersection finder for this geometry.
|
PointOnGeometryLocator |
getPointLocator() |
Polygon |
getPolygon() |
List<Point> |
getRepresentativePoints()
Gets the list of representative points for this geometry.
|
LinearRing |
getRing(int ringIndex) |
int |
getRingCount() |
List<LinearRing> |
getRings() |
boolean |
intersects(Geometry geometry)
Tests whether this geometry intersects the argument geometry.
|
Polygon |
prepare() |
appendVertex, clone, compareToSameClass, computeBoundingBox, convexHull, copy, deleteVertex, doEquals, equalsExact, getArea, getBoundary, getBoundaryDimension, getDataType, getDimension, getExteriorRing, getGeometryComponents, getGeometryFactory, getInteriorRing, getLength, getNumInteriorRing, getPoint, getPointWithin, getSegment, getToVertex, getVertex, getVertexCount, holes, insertVertex, intersects, isEmpty, isEquivalentClass, isRectangle, minCoordinateIndex, move, moveVertex, normalize, reverse, rings, scroll, segments, toClockwise, toCounterClockwise, verticesbuffer, buffer, buffer, checkNotGeometryCollection, compare, compareTo, convert, convert, coveredBy, createVertexId, crosses, difference, disjoint, distance, envelopeCovers, envelopesIntersect, equal, equals, equals, equals, equalsExact, equalsNorm, equalsTopo, geometries, getAxisCount, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometries, getGeometry, getGeometryCount, getGeometryType, getInteriorPoint, getNonZeroGeometryFactory, getSrid, getUserData, getVertexIndex, hashCode, hasInvalidXyCoordinates, hasNonEmptyElements, hasNullElements, intersection, isAnyTargetComponentInTest, isGeometryCollection, isSimple, isValid, isWithinDistance, overlaps, relate, relate, setUserData, setVertexIndex, symDifference, toString, touches, toWkt, union, union, withinfinalize, getClass, notify, notifyAll, wait, wait, waitbuffer, buffer, buffer, compareTo, convert, convert, coveredBy, crosses, difference, disjoint, distance, equal, equals, equals, equals, equalsExact, equalsNorm, equalsTopo, geometries, getAxisCount, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometries, getGeometry, getGeometryCount, getGeometryType, getInteriorPoint, getSrid, getUserData, hashCode, hasInvalidXyCoordinates, intersection, isSimple, isValid, isWithinDistance, overlaps, relate, relate, setUserData, symDifference, touches, toWkt, union, union, withinpublic PreparedPolygon(Polygon polygon)
public boolean contains(Geometry g)
AbstractGeometry
The contains predicate has the following equivalent definitions:
[T*****FF*]
g.within(this) = true
contains is the converse of AbstractGeometry.within(com.revolsys.jts.geom.Geometry) )
B.contains(A) = false.
(As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.)
For a predicate with similar behaviour but avoiding
this subtle limitation, see AbstractGeometry.covers(com.revolsys.jts.geom.Geometry).contains in interface Geometrycontains in class AbstractGeometryg - the Geometry with which to compare this Geometrytrue if this Geometry contains gGeometry.within(com.revolsys.jts.geom.Geometry),
Geometry.covers(com.revolsys.jts.geom.Geometry)public boolean containsProperly(Geometry geometry)
containsProperly in interface GeometrycontainsProperly in class AbstractGeometrypublic boolean covers(Geometry geometry)
AbstractGeometry
The covers predicate has the following equivalent definitions:
[T*****FF*]
[*T****FF*]
[***T**FF*]
[****T*FF*]
g.coveredBy(this) = true
covers is the converse of AbstractGeometry.coveredBy(com.revolsys.jts.geom.Geometry))
false.
This predicate is similar to AbstractGeometry.contains(com.revolsys.jts.geom.Geometry),
but is more inclusive (i.e. returns true for more cases).
In particular, unlike contains it does not distinguish between
points in the boundary and in the interior of geometries.
For most situations, covers should be used in preference to contains.
As an added benefit, covers is more amenable to optimization,
and hence should be more performant.
covers in interface Geometrycovers in class AbstractGeometrygeometry - the Geometry with which to compare this Geometrytrue if this Geometry covers gGeometry.contains(com.revolsys.jts.geom.Geometry),
Geometry.coveredBy(com.revolsys.jts.geom.Geometry)public BoundingBox getBoundingBox()
AbstractGeometryBoundingBoxDoubleGf containing
the minimum and maximum x and y values in this Geometry.
If the geometry is empty, an empty BoundingBoxDoubleGf
is returned.
The returned object is a copy of the one maintained internally, to avoid aliasing issues. For best performance, clients which access this boundingBox frequently should cache the return value.
getBoundingBox in interface GeometrygetBoundingBox in interface PolygonalgetBoundingBox in class AbstractGeometryGeometry.public FastSegmentSetIntersectionFinder getIntersectionFinder()
public PointOnGeometryLocator getPointLocator()
public Polygon getPolygon()
public List<Point> getRepresentativePoints()
public LinearRing getRing(int ringIndex)
public int getRingCount()
public List<LinearRing> getRings()
public boolean intersects(Geometry geometry)
AbstractGeometry
The intersects predicate has the following equivalent definitions:
[T********]
[*T*******]
[***T*****]
[****T****]
! g.disjoint(this) = true
intersects is the inverse of disjoint)
intersects in interface Geometryintersects in class AbstractGeometrygeometry - the Geometry with which to compare this Geometrytrue if the two Geometrys intersectGeometry.disjoint(com.revolsys.jts.geom.Geometry)Copyright © 2015 Revolution Systems Inc.. All rights reserved.