Package com.kheops.jmap.spatial
Class MultiPolygon
java.lang.Object
com.kheops.jmap.spatial.DefaultGeometry
com.kheops.jmap.spatial.GeometryCollection
com.kheops.jmap.spatial.MultiSurface
com.kheops.jmap.spatial.MultiPolygon
- All Implemented Interfaces:
Geometry
,PolygonTypeGeometry
,Serializable
,Cloneable
This class represents a collection of Polygon
A single Polygon is allowed even if it's not the correct class.
A single Polygon is allowed even if it's not the correct class.
- See Also:
-
Field Summary
Fields inherited from class com.kheops.jmap.spatial.GeometryCollection
bounds, geometries
Fields 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 TypeMethodDescriptioncentroid()
Calculates centroid of this collection of polygons.clone()
Clones this geometry.This method returns a point that is typically centered on the geometry.short
Returns the geometry class id.int
Returns the geometry type for this geometry.Polygon[]
getRings()
a Point on one of the polygonPoint[]
Returns this geometry as an array of Point.void
setGeometries
(Geometry[] geometries) void
setPolygons
(Polygon[] polygons) toString()
Returns information about the current geometry.Methods inherited from class com.kheops.jmap.spatial.GeometryCollection
area, boundary, createBounds, equals, fit, geometryN, getBounds, getGeometries, getGeometryCount, hashCode, keepLineString, keepLineString, keepPoint, keepPoint, keepPolygon, keepPolygon, length, numGeometries, sizeOf, spatiallyEquals, transform, translate, validate
Methods inherited from class com.kheops.jmap.spatial.DefaultGeometry
asText, spatiallyEquals
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.kheops.jmap.spatial.Geometry
asText, boundary, createBounds, getBounds, length, sizeOf, spatiallyEquals, spatiallyEquals, transform, translate
Methods inherited from interface com.kheops.jmap.spatial.PolygonTypeGeometry
area
-
Constructor Details
-
MultiPolygon
public MultiPolygon() -
MultiPolygon
-
-
Method Details
-
clone
Description copied from class:GeometryCollection
Clones this geometry.- Specified by:
clone
in interfaceGeometry
- Specified by:
clone
in classGeometryCollection
- Returns:
- a deep copy of the current geometry.
-
centroid
Calculates centroid of this collection of polygons.
Computed as the center of mass of the centroids of polygons, weighted by their area- Specified by:
centroid
in interfacePolygonTypeGeometry
- Specified by:
centroid
in classMultiSurface
- Returns:
-
serialize
Description copied from class:GeometryCollection
Returns this geometry as an array of Point.- Specified by:
serialize
in interfaceGeometry
- Overrides:
serialize
in classGeometryCollection
- Returns:
- this geometry as an array of Point.
-
pointOnSurface
a Point on one of the polygon- Specified by:
pointOnSurface
in interfacePolygonTypeGeometry
- Specified by:
pointOnSurface
in classMultiSurface
- Returns:
-
getPolygons
- Returns:
-
setGeometries
- Specified by:
setGeometries
in classGeometryCollection
-
setPolygons
- Parameters:
polygons
-
-
polygonIterator
- Specified by:
polygonIterator
in interfacePolygonTypeGeometry
-
toString
Description copied from interface:Geometry
Returns information about the current geometry. -
getGeometryId
public short getGeometryId()Description copied from interface:Geometry
Returns the geometry class id. This method is useful for geometry serialization.- Specified by:
getGeometryId
in interfaceGeometry
- Returns:
- the geometry id.
-
getGeometryType
public int getGeometryType()Description copied from interface:Geometry
Returns the geometry type for this geometry.- Specified by:
getGeometryType
in interfaceGeometry
- Returns:
- the geometry type.
- See Also:
-
getCenteredPoint
Description copied from interface:Geometry
This method returns a point that is typically centered on the geometry. If the geometry is a point, the point is returned. If it is a line, a point on the curve interpolated at 50% is returned. If the geometry is a surface, the centroid is returned if it is inside the polygon, if not, a point inside the polygon (but likely not exactly in the center) will be returned. If the geometry is a collection, the method is called on the first part of the collection.- Specified by:
getCenteredPoint
in interfaceGeometry
- Returns:
- a point likely at the center of the geometry
- See Also:
-
getRings
-