public abstract class AbstractGeometryCollection extends AbstractGeometry implements GeometryCollection
Geometrys of
arbitrary type and dimension.| Constructor and Description |
|---|
AbstractGeometryCollection() |
| Modifier and Type | Method and Description |
|---|---|
<V extends Geometry> |
appendVertex(Point newPoint,
int... geometryId) |
AbstractGeometryCollection |
clone()
Creates and returns a full copy of this
GeometryCollection object. |
int |
compareToSameClass(Geometry geometry)
Returns whether this
Geometry is greater than, equal to,
or less than another Geometry having the same class. |
protected BoundingBox |
computeBoundingBox()
Returns the minimum and maximum x and y values in this
Geometry
, or a null BoundingBoxDoubleGf if this Geometry is empty. |
<V extends Geometry> |
copy(GeometryFactory geometryFactory)
Create a copy of the geometry io the requried geometry factory.
|
<V extends Geometry> |
deleteVertex(int... vertexId) |
protected boolean |
doEquals(int axisCount,
Geometry geometry) |
boolean |
equalsExact(Geometry other,
double tolerance)
Returns true if the two
Geometrys are exactly equal,
up to a specified distance tolerance. |
Iterable<Geometry> |
geometries() |
double |
getArea()
Returns the area of this
GeometryCollection |
Geometry |
getBoundary()
Returns the boundary, or an empty geometry of appropriate dimension
if this
Geometry is empty. |
int |
getBoundaryDimension()
Returns the dimension of this
Geometrys inherent boundary. |
DataType |
getDataType() |
int |
getDimension()
Returns the dimension of this geometry.
|
<V extends Geometry> |
getGeometries(Class<V> geometryClass) |
<V extends Geometry> |
getGeometryComponents(Class<V> geometryClass)
Differs from
Geometry.getGeometries(Class) in that it will return matching Polygon.rings() |
double |
getLength()
Returns the length of this
Geometry. |
Point |
getPoint()
Returns a vertex of this
Geometry
(usually, but not necessarily, the first one). |
Point |
getPointWithin() |
Segment |
getSegment(int... segmentId)
Get the
Segment at the specified vertexId (see Segment.getSegmentId()). |
Vertex |
getToVertex(int... vertexId)
Get the
Vertex at the specified vertexId starting at the end of the geometry (see Vertex.getVertexId()). |
Vertex |
getVertex(int... vertexId)
Get the
Vertex at the specified vertexId (see Vertex.getVertexId()). |
int |
getVertexCount()
Returns the count of this
Geometrys vertices. |
<V extends Geometry> |
insertVertex(Point newPoint,
int... vertexId) |
boolean |
intersects(BoundingBox boundingBox) |
boolean |
isEmpty()
Tests whether the set of points covered by this
Geometry is
empty. |
protected boolean |
isEquivalentClass(Geometry other)
Returns whether the two
Geometrys are equal, from the point
of view of the equalsExact method. |
Geometry |
move(double... deltas) |
<V extends Geometry> |
moveVertex(Point newPoint,
int... vertexId) |
GeometryCollection |
normalize()
Converts this
Geometry to normal form (or
canonical form ). |
GeometryCollection |
reverse()
Creates a
GeometryCollection with
every component reversed. |
Reader<Segment> |
segments() |
<G extends Geometry> |
toClockwise() |
<G extends Geometry> |
toCounterClockwise() |
Reader<Vertex> |
vertices()
|
buffer, buffer, buffer, checkNotGeometryCollection, compare, compareTo, contains, containsProperly, convert, convert, convexHull, coveredBy, covers, createVertexId, crosses, difference, disjoint, distance, envelopeCovers, envelopesIntersect, equal, equals, equals, equals, equalsExact, equalsNorm, equalsTopo, getAxisCount, getBoundingBox, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometry, getGeometryCount, getGeometryFactory, getGeometryType, getInteriorPoint, getNonZeroGeometryFactory, getSrid, getUserData, getVertexIndex, hashCode, hasInvalidXyCoordinates, hasNonEmptyElements, hasNullElements, intersection, intersects, isAnyTargetComponentInTest, isGeometryCollection, isRectangle, isSimple, isValid, isWithinDistance, overlaps, relate, relate, setUserData, setVertexIndex, symDifference, toString, touches, toWkt, union, union, withinfinalize, getClass, notify, notifyAll, wait, wait, waitbuffer, buffer, buffer, compareTo, contains, containsProperly, convert, convert, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, equal, equals, equals, equals, equalsExact, equalsNorm, equalsTopo, getAxisCount, getBoundingBox, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometry, getGeometryCount, getGeometryFactory, getGeometryType, getInteriorPoint, getSrid, getUserData, hashCode, hasInvalidXyCoordinates, intersection, intersects, isRectangle, isSimple, isValid, isWithinDistance, overlaps, prepare, relate, relate, setUserData, symDifference, touches, toWkt, union, union, withinpublic <V extends Geometry> V appendVertex(Point newPoint, int... geometryId)
appendVertex in interface Geometrypublic AbstractGeometryCollection clone()
GeometryCollection object.
(including all coordinates contained by it).clone in interface Geometryclone in interface GeometryCollectionclone in class AbstractGeometrypublic int compareToSameClass(Geometry geometry)
AbstractGeometryGeometry is greater than, equal to,
or less than another Geometry having the same class.compareToSameClass in interface GeometrycompareToSameClass in class AbstractGeometrygeometry - a Geometry having the same class as this Geometryo, as
defined in "Normal Form For Geometry" in the JTS Technical
Specificationsprotected BoundingBox computeBoundingBox()
AbstractGeometryGeometry
, or a null BoundingBoxDoubleGf if this Geometry is empty.
Unlike getEnvelopeInternal, this method calculates the BoundingBoxDoubleGf
each time it is called; getEnvelopeInternal caches the result
of this method.computeBoundingBox in class AbstractGeometryGeometrys bounding box; if the Geometry
is empty, BoundingBoxDoubleGf#isNull will return truepublic <V extends Geometry> V copy(GeometryFactory geometryFactory)
Geometrypublic <V extends Geometry> V deleteVertex(int... vertexId)
deleteVertex in interface Geometryprotected boolean doEquals(int axisCount,
Geometry geometry)
doEquals in class AbstractGeometrypublic boolean equalsExact(Geometry other, double tolerance)
AbstractGeometryGeometrys are exactly equal,
up to a specified distance tolerance.
Two Geometries are exactly equal within a distance tolerance
if and only if:
GeometryFactory, the SRID,
or the userData fields.
To properly test equality between different geometries,
it is usually necessary to AbstractGeometry.normalize() them first.
equalsExact in interface GeometryequalsExact in class AbstractGeometryother - the Geometry with which to compare this Geometrytolerance - distance at or below which two Coordinates
are considered equaltrue if this and the other Geometry
have identical structure and point values, up to the distance tolerance.AbstractGeometry.equals(2,Geometry),
AbstractGeometry.normalize(),
#norm()public Iterable<Geometry> geometries()
geometries in interface Geometrygeometries in class AbstractGeometrypublic double getArea()
GeometryCollectiongetArea in interface GeometrygetArea in class AbstractGeometrypublic Geometry getBoundary()
AbstractGeometryGeometry is empty.
(In the case of zero-dimensional geometries, '
an empty GeometryCollection is returned.)
For a discussion of this function, see the OpenGIS Simple
Features Specification. As stated in SFS Section 2.1.13.1, "the boundary
of a Geometry is a set of Geometries of the next lower dimension."getBoundary in interface GeometrygetBoundary in class AbstractGeometryGeometrypublic int getBoundaryDimension()
AbstractGeometryGeometrys inherent boundary.getBoundaryDimension in interface GeometrygetBoundaryDimension in class AbstractGeometryDimension.FALSE if the boundary is the empty geometry.public DataType getDataType()
getDataType in interface DataTypeProxygetDataType in class AbstractGeometrypublic int getDimension()
AbstractGeometry
Note that this is a different concept to the dimension of
the vertex Coordinatess.
The geometry dimension can never be greater than the coordinate dimension.
For example, a 0-dimensional geometry (e.g. a Point)
may have a coordinate dimension of 3 (X,Y,Z).
getDimension in interface GeometrygetDimension in class AbstractGeometrypublic <V extends Geometry> List<V> getGeometries(Class<V> geometryClass)
getGeometries in interface GeometrygetGeometries in class AbstractGeometrypublic <V extends Geometry> List<V> getGeometryComponents(Class<V> geometryClass)
GeometryGeometry.getGeometries(Class) in that it will return matching Polygon.rings()getGeometryComponents in interface GeometrygetGeometryComponents in class AbstractGeometrypublic double getLength()
AbstractGeometryGeometry.
Linear geometries return their length.
Areal geometries return their perimeter.
They override this function to compute the area.
Others return 0.0getLength in interface GeometrygetLength in class AbstractGeometrypublic Point getPoint()
AbstractGeometryGeometry
(usually, but not necessarily, the first one).
The returned coordinate should not be assumed
to be an actual Point object used in
the internal representation.getPoint in interface GeometrygetPoint in class AbstractGeometryCoordinates which is a vertex of this Geometry.public Point getPointWithin()
getPointWithin in interface Geometrypublic Segment getSegment(int... segmentId)
GeometryGet the Segment at the specified vertexId (see Segment.getSegmentId()).
getSegment in interface Geometrypublic Vertex getToVertex(int... vertexId)
GeometryGet the Vertex at the specified vertexId starting at the end of the geometry (see Vertex.getVertexId()).
getToVertex in interface GeometryvertexId - The id of the vertex.public Vertex getVertex(int... vertexId)
GeometryGet the Vertex at the specified vertexId (see Vertex.getVertexId()).
public int getVertexCount()
GeometryGeometrys vertices. The Geometry
s contained by composite Geometrys must be
Geometry's; that is, they must implement getNumPointsgetVertexCount in interface GeometryGeometrypublic <V extends Geometry> V insertVertex(Point newPoint, int... vertexId)
insertVertex in interface Geometrypublic boolean intersects(BoundingBox boundingBox)
intersects in interface Geometrypublic boolean isEmpty()
AbstractGeometryGeometry is
empty.isEmpty in interface GeometryisEmpty in class AbstractGeometrytrue if this Geometry does not cover any pointsprotected boolean isEquivalentClass(Geometry other)
AbstractGeometryGeometrys are equal, from the point
of view of the equalsExact method. Called by equalsExact
. In general, two Geometry classes are considered to be
"equivalent" only if they are the same class. An exception is LineString
, which is considered to be equivalent to its subclasses.isEquivalentClass in class AbstractGeometryother - the Geometry with which to compare this Geometry
for equalitytrue if the classes of the two Geometry
s are considered to be equal by the equalsExact method.public <V extends Geometry> V moveVertex(Point newPoint, int... vertexId)
moveVertex in interface Geometrypublic GeometryCollection normalize()
AbstractGeometryGeometry to normal form (or
canonical form ). Normal form is a unique representation for Geometry
s. It can be used to test whether two Geometrys are equal
in a way that is independent of the ordering of the coordinates within
them. Normal form equality is a stronger condition than topological
equality, but weaker than pointwise equality. The definitions for normal
form use the standard lexicographical ordering for coordinates. "Sorted in
order of coordinates" means the obvious extension of this ordering to
sequences of coordinates.normalize in interface Geometrynormalize in interface GeometryCollectionnormalize in class AbstractGeometryAbstractGeometry.normalize()public GeometryCollection reverse()
GeometryCollection with
every component reversed.
The order of the components in the collection are not reversed.reverse in interface Geometryreverse in class AbstractGeometryGeometryCollection in the reverse orderpublic <G extends Geometry> G toClockwise()
toClockwise in interface GeometrytoClockwise in class AbstractGeometrypublic <G extends Geometry> G toCounterClockwise()
toCounterClockwise in interface GeometrytoCounterClockwise in class AbstractGeometrypublic Reader<Vertex> vertices()
GeometryGet an Iterable that iterates over the Vertex of the geometry. For memory
efficiency the Vertex returned is the same instance for each call to next
on the iterator. If the vertex is required to track the previous vertex then the
Vertex.clone() method must be called to get a copy of the vertex.
The Iterable.iterator() method always returns the same Iterator instance.
Therefore that method should not be called more than once.
Copyright © 2015 Revolution Systems Inc.. All rights reserved.