
JTS Topology Suite version 1.12  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object com.vividsolutions.jts.geom.Geometry com.vividsolutions.jts.geom.GeometryCollection
public class GeometryCollection
Models a collection of Geometry
s of
arbitrary type and dimension.
Field Summary  

protected Geometry[] 
geometries
Internal representation of this GeometryCollection . 
Fields inherited from class com.vividsolutions.jts.geom.Geometry 

envelope, factory, SRID 
Constructor Summary  

GeometryCollection(Geometry[] geometries,
GeometryFactory factory)


GeometryCollection(Geometry[] geometries,
PrecisionModel precisionModel,
int SRID)
Deprecated. Use GeometryFactory instead 
Method Summary  

void 
apply(CoordinateFilter filter)
Performs an operation with or on this Geometry 's
coordinates. 
void 
apply(CoordinateSequenceFilter filter)
Performs an operation on the coordinates in this Geometry 's
CoordinateSequence s. 
void 
apply(GeometryComponentFilter filter)
Performs an operation with or on this Geometry and its component Geometry's. 
void 
apply(GeometryFilter filter)
Performs an operation with or on this Geometry and its
subelement Geometry s (if any). 
java.lang.Object 
clone()
Creates and returns a full copy of this GeometryCollection object. 
protected int 
compareToSameClass(java.lang.Object o)
Returns whether this Geometry is greater than, equal to,
or less than another Geometry having the same class. 
protected int 
compareToSameClass(java.lang.Object o,
CoordinateSequenceComparator comp)
Returns whether this Geometry is greater than, equal to,
or less than another Geometry of the same class. 
protected Envelope 
computeEnvelopeInternal()
Returns the minimum and maximum x and y values in this Geometry
, or a null Envelope if this Geometry is empty. 
boolean 
equalsExact(Geometry other,
double tolerance)
Returns true if the two Geometry s are exactly equal,
up to a specified distance tolerance. 
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 Geometry s inherent boundary. 
Coordinate 
getCoordinate()
Returns a vertex of this Geometry
(usually, but not necessarily, the first one). 
Coordinate[] 
getCoordinates()
Collects all coordinates of all subgeometries into an Array. 
int 
getDimension()
Returns the dimension of this geometry. 
Geometry 
getGeometryN(int n)
Returns an element Geometry from a GeometryCollection
(or this , if the geometry is not a collection). 
java.lang.String 
getGeometryType()
Returns the name of this object's com.vivid.jts.geom
interface. 
double 
getLength()
Returns the length of this Geometry . 
int 
getNumGeometries()
Returns the number of Geometry s in a GeometryCollection
(or 1, if the geometry is not a collection). 
int 
getNumPoints()
Returns the count of this Geometry s vertices. 
boolean 
isEmpty()
Returns whether or not the set of points in this Geometry is
empty. 
void 
normalize()
Converts this Geometry to normal form (or
canonical form ). 
Geometry 
reverse()
Creates a GeometryCollection with
every component reversed. 
Methods inherited from class com.vividsolutions.jts.geom.Geometry 

buffer, buffer, buffer, checkNotGeometryCollection, compare, compareTo, compareTo, contains, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, equal, equals, equals, equalsExact, equalsNorm, equalsTopo, geometryChanged, geometryChangedAction, getCentroid, getEnvelope, getEnvelopeInternal, getFactory, getInteriorPoint, getPrecisionModel, getSRID, getUserData, hashCode, hasNonEmptyElements, hasNullElements, intersection, intersects, isEquivalentClass, isGeometryCollection, isRectangle, isSimple, isValid, isWithinDistance, norm, overlaps, relate, relate, setSRID, setUserData, symDifference, toString, toText, touches, union, union, within 
Methods inherited from class java.lang.Object 

finalize, getClass, notify, notifyAll, wait, wait, wait 
Field Detail 

protected Geometry[] geometries
GeometryCollection
.
Constructor Detail 

public GeometryCollection(Geometry[] geometries, PrecisionModel precisionModel, int SRID)
public GeometryCollection(Geometry[] geometries, GeometryFactory factory)
geometries
 the Geometry
s for this GeometryCollection
,
or null
or an empty array to create the empty
geometry. Elements may be empty Geometry
s,
but not null
s.Method Detail 

public Coordinate getCoordinate()
Geometry
Geometry
(usually, but not necessarily, the first one).
The returned coordinate should not be assumed
to be an actual Coordinate object used in
the internal representation.
getCoordinate
in class Geometry
Coordinate
which is a vertex of this Geometry
.public Coordinate[] getCoordinates()
getCoordinates
in class Geometry
Geometry.geometryChanged()
,
CoordinateSequence.setOrdinate(int, int, double)
public boolean isEmpty()
Geometry
Geometry
is
empty.
isEmpty
in class Geometry
true
if this Geometry
equals the empty
geometrypublic int getDimension()
Geometry
Note that this is a different concept to the dimension of
the vertex Coordinate
s.
The geometry dimension can never be greater than the coordinate dimension.
For example, a 0dimensional geometry (e.g. a Point)
may have a coordinate dimension of 3 (X,Y,Z).
getDimension
in class Geometry
public int getBoundaryDimension()
Geometry
Geometry
s inherent boundary.
getBoundaryDimension
in class Geometry
Dimension.FALSE
if the boundary is the empty geometry.public int getNumGeometries()
Geometry
Geometry
s in a GeometryCollection
(or 1, if the geometry is not a collection).
getNumGeometries
in class Geometry
public Geometry getGeometryN(int n)
Geometry
Geometry
from a GeometryCollection
(or this
, if the geometry is not a collection).
getGeometryN
in class Geometry
n
 the index of the geometry element
public int getNumPoints()
Geometry
Geometry
s vertices. The Geometry
s contained by composite Geometry
s must be
Geometry's; that is, they must implement getNumPoints
getNumPoints
in class Geometry
Geometry
public java.lang.String getGeometryType()
Geometry
com.vivid.jts.geom
interface.
getGeometryType
in class Geometry
Geometry
s most specific com.vividsolutions.jts.geom
interfacepublic Geometry getBoundary()
Geometry
Geometry
is empty.
(In the case of zerodimensional 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 class Geometry
Geometry
public double getArea()
GeometryCollection
getArea
in class Geometry
public double getLength()
Geometry
Geometry
.
Linear geometries return their length.
Areal geometries return their perimeter.
They override this function to compute the area.
Others return 0.0
getLength
in class Geometry
public boolean equalsExact(Geometry other, double tolerance)
Geometry
Geometry
s are exactly equal,
up to a specified distance tolerance.
Two Geometries are exactly equal within a distance tolerance
if and only if:
To properly test equality between different geometries,
it is usually necessary to Geometry.normalize()
them first.
equalsExact
in class Geometry
other
 the Geometry
with which to compare this Geometry
tolerance
 distance at or below which two Coordinate
s
are considered equal
true
if this and the other Geometry
have identical structure and point values, up to the distance tolerance.Geometry.equalsExact(Geometry)
,
Geometry.normalize()
,
Geometry.norm()
public void apply(CoordinateFilter filter)
Geometry
Geometry
's
coordinates.
If this method modifies any coordinate values,
Geometry.geometryChanged()
must be called to update the geometry state.
Note that you cannot use this method to
modify this Geometry if its underlying CoordinateSequence's #get method
returns a copy of the Coordinate, rather than the actual Coordinate stored
(if it even stores Coordinate objects at all).
apply
in class Geometry
filter
 the filter to apply to this Geometry
's
coordinatespublic void apply(CoordinateSequenceFilter filter)
Geometry
Geometry
's
CoordinateSequence
s.
If the filter reports that a coordinate value has been changed,
Geometry.geometryChanged()
will be called automatically.
apply
in class Geometry
filter
 the filter to applypublic void apply(GeometryFilter filter)
Geometry
Geometry
and its
subelement Geometry
s (if any).
Only GeometryCollections and subclasses
have subelement Geometry's.
apply
in class Geometry
filter
 the filter to apply to this Geometry
(and
its children, if it is a GeometryCollection
).public void apply(GeometryComponentFilter filter)
Geometry
apply
in class Geometry
filter
 the filter to apply to this Geometry
.public java.lang.Object clone()
GeometryCollection
object.
(including all coordinates contained by it).
clone
in class Geometry
public void normalize()
Geometry
Geometry
to normal form (or
canonical form ). Normal form is a unique representation for Geometry
s. It can be used to test whether two Geometry
s 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.
NOTE that this method mutates the value of this geometry inplace. If this is not safe and/or wanted, the geometry should be cloned prior to normalization.
normalize
in class Geometry
protected Envelope computeEnvelopeInternal()
Geometry
Geometry
, or a null Envelope
if this Geometry
is empty.
Unlike getEnvelopeInternal
, this method calculates the Envelope
each time it is called; getEnvelopeInternal
caches the result
of this method.
computeEnvelopeInternal
in class Geometry
Geometry
s bounding box; if the Geometry
is empty, Envelope#isNull
will return true
protected int compareToSameClass(java.lang.Object o)
Geometry
Geometry
is greater than, equal to,
or less than another Geometry
having the same class.
compareToSameClass
in class Geometry
o
 a Geometry
having the same class as this Geometry
o
, as
defined in "Normal Form For Geometry" in the JTS Technical
Specificationsprotected int compareToSameClass(java.lang.Object o, CoordinateSequenceComparator comp)
Geometry
Geometry
is greater than, equal to,
or less than another Geometry
of the same class.
using the given CoordinateSequenceComparator
.
compareToSameClass
in class Geometry
o
 a Geometry
having the same class as this Geometry
comp
 a CoordinateSequenceComparator
o
, as
defined in "Normal Form For Geometry" in the JTS Technical
Specificationspublic Geometry reverse()
GeometryCollection
with
every component reversed.
The order of the components in the collection are not reversed.
reverse
in class Geometry
GeometryCollection
in the reverse order

JTS Topology Suite version 1.12  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 