Package com.massifmaps.geometry
Class MultiGeometry
java.lang.Object
com.massifmaps.geometry.Geometry
com.massifmaps.geometry.MultiGeometry
- Direct Known Subclasses:
MultiLineGeometry,MultiPointGeometry,MultiPolygonGeometry
A generic multi geometry container.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiGeometry(GeometryVector geometries) Constructs a MultiGeometry from a vector of geometry objects. -
Method Summary
Modifier and TypeMethodDescriptionReturns the center point of the geometry.getGeometry(int index) Returns the geometry at the specified index.intReturns the number of geometry objects in this multi geometry container.intgetType()Returns what kind of geometry this is.
Without it the only way to tell a MultiPoint from a Point is a downcast, or - from a
scripting binding - matching on the wrapper's class name.Methods inherited from class com.massifmaps.geometry.Geometry
equals, getBounds, getGeoJSON, hashCode
-
Constructor Details
-
MultiGeometry
Constructs a MultiGeometry from a vector of geometry objects.- Parameters:
geometries- The geometries for multi geometry.
-
-
Method Details
-
getCenterPos
Description copied from class:GeometryReturns the center point of the geometry.- Overrides:
getCenterPosin classGeometry- Returns:
- The center point of the geometry.
-
getType
public int getType()Description copied from class:GeometryReturns what kind of geometry this is.
Without it the only way to tell a MultiPoint from a Point is a downcast, or - from a
scripting binding - matching on the wrapper's class name. -
getGeometryCount
public int getGeometryCount()Returns the number of geometry objects in this multi geometry container.- Returns:
- The number of geometry objects.
-
getGeometry
Returns the geometry at the specified index. Index must be between 0 and getGeometryCount (exclusive)- Parameters:
index- The index of the geometry.- Returns:
- The geometry at specified index.
- Throws:
IndexOutOfBoundsException- If the index is out of range.
-