public class GeometryCollection<P extends Position,G extends Geometry<P>> extends Geometry<P> implements Complex<P,G>
Geometry
that is an ordered collection of some number of Geometry
s.
All elements in a GeometryCollection
must be in the same CoordinateReferenceSystem
,
which is also the CoordinateReferenceSystem
for the GeometryCollection
.
Modifier and Type | Field and Description |
---|---|
protected Geometry<P>[] |
geometries |
Constructor and Description |
---|
GeometryCollection(CoordinateReferenceSystem<P> crs)
Constructs an empty
GeometryCollection |
GeometryCollection(G... geometries)
Constructs a
GeometryCollection from the specified Geometry s. |
Modifier and Type | Method and Description |
---|---|
void |
accept(GeometryVisitor<P> visitor)
Accepts the
GeometryVisitor , and
will pass it to it's constituent Geometries . |
G[] |
components()
Returns the components
|
Class<? extends Geometry> |
getComponentType()
Returns the
Class of which all constituent Geometry s are instances. |
int |
getDimension()
Returns the topological dimension of this instance.
|
G |
getGeometryN(int num)
Returns the
Geometry element at the specified (zero-based) position in this GeometryCollection . |
GeometryType |
getGeometryType()
Returns the type of this
Geometry . |
int |
getNumGeometries()
Returns the number of elements in this
GeometryCollection . |
Iterator<G> |
iterator()
Creates an
Iterator over the elements of this GeometryCollection . |
equals, forceToCrs, getCoordinateDimension, getCoordinateReferenceSystem, getCrs, getEnvelope, getNumPositions, getPositionClass, getPositionN, getPositions, getSRID, hashCode, isEmpty, nestPositionSequences, toString, writeReplace
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
@SafeVarargs public GeometryCollection(G... geometries)
GeometryCollection
from the specified Geometry
s.geometries
- the Geometry
s that are the elements of the constructed GeometryCollection
.public GeometryCollection(CoordinateReferenceSystem<P> crs)
GeometryCollection
public int getNumGeometries()
GeometryCollection
.public Class<? extends Geometry> getComponentType()
Complex
Class
of which all constituent Geometry
s are instances.public G[] components()
public G getGeometryN(int num)
Geometry
element at the specified (zero-based) position in this GeometryCollection
.num
- the position in the collection of the requested Geometry
Geometry
at the position specified by the num parameter.public int getDimension()
Geometry
Geometries
.getDimension
in class Geometry<P extends Position>
public GeometryType getGeometryType()
Geometry
Geometry
.getGeometryType
in class Geometry<P extends Position>
GeometryType
of this instance.public Iterator<G> iterator()
Iterator
over the elements of this GeometryCollection
.Copyright © 2024 geolatte.org. All rights reserved.