public abstract class GeometryCollection extends DefaultGeometry
| Modifier and Type | Field and Description |
|---|---|
protected Rectangle |
bounds |
protected Geometry[] |
geometries |
GEOMETRY_ANNOTATION, GEOMETRY_COMPLEX, GEOMETRY_ELLIPSE, GEOMETRY_LINE, GEOMETRY_LINEAR_RING, GEOMETRY_LINESTRING, GEOMETRY_MULTI_ANNOTATION, GEOMETRY_MULTI_LINESTRING, GEOMETRY_MULTI_POINT, GEOMETRY_MULTI_POLYGON, GEOMETRY_POINT, GEOMETRY_POLYGON, GEOMETRY_RECTANGLE| Constructor and Description |
|---|
GeometryCollection() |
GeometryCollection(Geometry[] geometries) |
| Modifier and Type | Method and Description |
|---|---|
double |
area()
Returns the geometry area.
|
Geometry |
boundary()
The boundary of this geometryCollection, made of the boundary of each
element
|
abstract GeometryCollection |
clone()
Clones this geometry.
|
void |
createBounds()
creates the bounding box
called in the constructor, not needed from outside |
boolean |
equals(java.lang.Object o) |
static Geometry |
fit(java.util.List<Geometry> list)
returns the best type of collection for the element in the List
|
Geometry |
geometryN(int N) |
Rectangle |
getBounds()
the BoundingBox
|
Geometry[] |
getGeometries() |
int |
getGeometryCount() |
int |
hashCode() |
static LineTypeGeometry |
keepLineString(Geometry g) |
static LineTypeGeometry |
keepLineString(java.util.List geometries) |
static PointTypeGeometry |
keepPoint(Geometry g) |
static PointTypeGeometry |
keepPoint(java.util.List geometries)
warning : it alters the List geometries (by removing all except Point, and
breaking MultiPoint into Point)
|
static PolygonTypeGeometry |
keepPolygon(Geometry g) |
static PolygonTypeGeometry |
keepPolygon(java.util.List geometries) |
double |
length()
Returns the geometry length.
|
int |
numGeometries() |
Point[] |
serialize()
Returns this geometry as an array of Point.
|
abstract void |
setGeometries(Geometry[] geometries) |
int |
sizeOf()
Returns an approximation in bytes of the memory used by this geometry.
|
boolean |
spatiallyEquals(Geometry geometry,
PrecisionModel precisionModel)
Tests if this geometry is equal to the argument, on a topological point of view.
|
Geometry |
transform(Transformation tr)
Creates a clone of the current geometry and returns
the new instance transformed with the specified geometry transformation.
The returned geometry can be of any geometry types after the transformation. |
void |
translate(double dx,
double dy)
Translate this geometry with the specified values.
|
static Geometry |
validate(GeometryCollection geometryCollection)
Validates all geometries in the specified GeometryCollection, removing all geometries that aren't
georeferenced.
|
asText, spatiallyEqualsfinalize, getClass, notify, notifyAll, toString, wait, wait, waitgetCenteredPoint, getGeometryId, getGeometryType, toStringpublic GeometryCollection()
public GeometryCollection(Geometry[] geometries)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Geometry boundary()
public static Geometry validate(GeometryCollection geometryCollection)
geometryCollection - the geometry collection to validate.public static Geometry fit(java.util.List<Geometry> list)
list - public abstract void setGeometries(Geometry[] geometries)
public Rectangle getBounds()
public void createBounds()
public double area()
Geometrypublic double length()
Geometrypublic Point[] serialize()
public int numGeometries()
public Geometry geometryN(int N)
public Geometry[] getGeometries()
public int getGeometryCount()
public boolean spatiallyEquals(Geometry geometry, PrecisionModel precisionModel)
geometry - the geometry to be tested.precisionModel - the precision model to use while comparing geometries.public void translate(double dx,
double dy)
dx - translation on the X-axis.dy - translation on the Y-axis.public static PointTypeGeometry keepPoint(java.util.List geometries)
geometries - public static PointTypeGeometry keepPoint(Geometry g)
public static LineTypeGeometry keepLineString(java.util.List geometries)
public static LineTypeGeometry keepLineString(Geometry g)
public static PolygonTypeGeometry keepPolygon(java.util.List geometries)
public static PolygonTypeGeometry keepPolygon(Geometry g)
public abstract GeometryCollection clone()
clone in interface Geometryclone in class DefaultGeometrypublic Geometry transform(Transformation tr)
tr - the transformation to apply.public int sizeOf()