Package com.massifmaps.geometry
Class PolygonGeometry
java.lang.Object
com.massifmaps.geometry.Geometry
com.massifmaps.geometry.PolygonGeometry
Polygon geometry defined by an outer ring and optional multiple inner rings (holes).
-
Constructor Summary
ConstructorsConstructorDescriptionPolygonGeometry(MapPosVector poses) Constructs a PolygonGeometry objects from an outer ring.PolygonGeometry(MapPosVector poses, MapPosVectorVector holes) Constructs a PolygonGeometry objects from an outer ring and list of inner rings (holes).Constructs a PolygonGeometry objects from a list of rings.
It is assumed the the first ring is outer ring and all other rings are inner rings. -
Method Summary
Modifier and TypeMethodDescriptionReturns the center point of the geometry.getHoles()Returns the list of map position lists defining the inner rings of the polygon (holes).getPoses()Returns the list of map positions defining the outer ring of the polygon.getRings()Returns the list of map position lists defining the rings of the polygon.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
-
PolygonGeometry
Constructs a PolygonGeometry objects from an outer ring.- Parameters:
poses- The list of map positions defining the outer ring.
-
PolygonGeometry
Constructs a PolygonGeometry objects from an outer ring and list of inner rings (holes).- Parameters:
poses- The list of map positions defining the outer ring.holes- The list of map position lists defining the inner rings.
-
PolygonGeometry
Constructs a PolygonGeometry objects from a list of rings.
It is assumed the the first ring is outer ring and all other rings are inner rings.- Parameters:
rings- The list of map position lists defining the rings
-
-
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. -
getPoses
Returns the list of map positions defining the outer ring of the polygon.- Returns:
- The list of map positions defining the outer ring of the polygon.
-
getHoles
Returns the list of map position lists defining the inner rings of the polygon (holes).- Returns:
- The list of map position lists defining the inner rings of the polygon (holes).
-
getRings
Returns the list of map position lists defining the rings of the polygon.- Returns:
- The list of map position lists defining the rings of the polygon.
-