Package com.massifmaps.geometry
Class Geometry
java.lang.Object
com.massifmaps.geometry.Geometry
- Direct Known Subclasses:
LineGeometry,MultiGeometry,PointGeometry,PolygonGeometry
A base class for all geometry types.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this object is equal to the specified object.Returns the minimal bounds for the geometry.Returns the center point of the geometry.Returns the geometry as a GeoJSON string, in its own coordinates.
Here rather than only on Feature because serialising a shape otherwise means constructing
a GeoJSONGeometryWriter, which no string-based binding can do.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.inthashCode()Returns the hash value of this object.
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getCenterPos
Returns the center point of the geometry.- Returns:
- The center point of the geometry.
-
getType
public int getType()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.- Returns:
- The geometry type.
-
getBounds
Returns the minimal bounds for the geometry.- Returns:
- The bounds for the geometry.
-
getGeoJSON
Returns the geometry as a GeoJSON string, in its own coordinates.
Here rather than only on Feature because serialising a shape otherwise means constructing
a GeoJSONGeometryWriter, which no string-based binding can do.- Returns:
- The geometry as GeoJSON.
-