Package com.kheops.jmap.spatial
Class GeometryCollection
java.lang.Object
com.kheops.jmap.spatial.DefaultGeometry
com.kheops.jmap.spatial.GeometryCollection
- All Implemented Interfaces:
Geometry,Serializable,Cloneable
- Direct Known Subclasses:
Complex,MultiAnnotation,MultiCurve,MultiPoint,MultiSurface
- See Also:
-
Field Summary
FieldsFields inherited from interface com.kheops.jmap.spatial.Geometry
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublearea()Returns the geometry area.boundary()The boundary of this geometryCollection, made of the boundary of each elementabstract GeometryCollectionclone()Clones this geometry.voidcreates the bounding box
called in the constructor, not needed from outsidebooleanstatic Geometryreturns the best type of collection for the element in the ListgeometryN(int N) the BoundingBoxGeometry[]intinthashCode()static LineTypeGeometrystatic LineTypeGeometrykeepLineString(List geometries) static PointTypeGeometrystatic PointTypeGeometrywarning : it alters the List geometries (by removing all except Point, and breaking MultiPoint into Point)static PolygonTypeGeometrystatic PolygonTypeGeometrykeepPolygon(List geometries) doublelength()Returns the geometry length.intPoint[]Returns this geometry as an array of Point.abstract voidsetGeometries(Geometry[] geometries) intsizeOf()Returns an approximation in bytes of the memory used by this geometry.booleanspatiallyEquals(Geometry geometry, PrecisionModel precisionModel) Tests if this geometry is equal to the argument, on a topological point of view.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.voidtranslate(double dx, double dy) Translate this geometry with the specified values.static Geometryvalidate(GeometryCollection geometryCollection) Validates all geometries in the specified GeometryCollection, removing all geometries that aren't georeferenced.Methods inherited from class com.kheops.jmap.spatial.DefaultGeometry
asText, spatiallyEqualsMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kheops.jmap.spatial.Geometry
getCenteredPoint, getGeometryId, getGeometryType, toString
-
Field Details
-
bounds
-
geometries
-
-
Constructor Details
-
GeometryCollection
public GeometryCollection() -
GeometryCollection
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
boundary
The boundary of this geometryCollection, made of the boundary of each element- Returns:
- a line string which defines the boundary of the current geometry.
-
validate
Validates all geometries in the specified GeometryCollection, removing all geometries that aren't georeferenced. If the remaining geometry list is empty, then null is returned.- Parameters:
geometryCollection- the geometry collection to validate.- Returns:
- the validated geometry collection, of null if the specified geometry collection doesn't contain any valid geometries.
-
fit
returns the best type of collection for the element in the List- Parameters:
list-
-
setGeometries
-
getBounds
the BoundingBox- Returns:
- the bounding box of this geometry.
-
createBounds
public void createBounds()creates the bounding box
called in the constructor, not needed from outside -
area
public double area()Description copied from interface:GeometryReturns the geometry area. If the geometry is not a surface, then 0 shall be returned.- Returns:
- the geometry area.
-
length
public double length()Description copied from interface:GeometryReturns the geometry length. If the geometry is a surface, then the geometry perimeter shall be returned.- Returns:
- the geometry length.
-
serialize
Returns this geometry as an array of Point.- Returns:
- this geometry as an array of Point.
-
numGeometries
public int numGeometries() -
geometryN
-
getGeometries
-
getGeometryCount
public int getGeometryCount() -
spatiallyEquals
Tests if this geometry is equal to the argument, on a topological point of view.- Parameters:
geometry- the geometry to be tested.precisionModel- the precision model to use while comparing geometries.- Returns:
- whether both geometries are spatially equals.
-
translate
public void translate(double dx, double dy) Translate this geometry with the specified values.- Parameters:
dx- translation on the X-axis.dy- translation on the Y-axis.
-
keepPoint
warning : it alters the List geometries (by removing all except Point, and breaking MultiPoint into Point)- Parameters:
geometries-- Returns:
-
keepPoint
-
keepLineString
-
keepLineString
-
keepPolygon
-
keepPolygon
-
clone
Clones this geometry.- Specified by:
clonein interfaceGeometry- Specified by:
clonein classDefaultGeometry- Returns:
- a deep copy of the current geometry.
-
transform
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.- Parameters:
tr- the transformation to apply.- Returns:
- the newly created and transformed geometry instance.
-
sizeOf
public int sizeOf()Returns an approximation in bytes of the memory used by this geometry.- Returns:
- the memory used by this geometry.
-