Class PolygonGeometry

java.lang.Object
com.massifmaps.geometry.Geometry
com.massifmaps.geometry.PolygonGeometry

public class PolygonGeometry extends Geometry
Polygon geometry defined by an outer ring and optional multiple inner rings (holes).
  • Constructor Details

    • PolygonGeometry

      public PolygonGeometry(MapPosVector poses)
      Constructs a PolygonGeometry objects from an outer ring.
      Parameters:
      poses - The list of map positions defining the outer ring.
    • PolygonGeometry

      public PolygonGeometry(MapPosVector poses, MapPosVectorVector holes)
      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

      public PolygonGeometry(MapPosVectorVector rings)
      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

      public MapPos getCenterPos()
      Description copied from class: Geometry
      Returns the center point of the geometry.
      Overrides:
      getCenterPos in class Geometry
      Returns:
      The center point of the geometry.
    • getType

      public int getType()
      Description copied from class: Geometry
      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.
      Overrides:
      getType in class Geometry
      Returns:
      The geometry type.
    • getPoses

      public MapPosVector 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

      public MapPosVectorVector 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

      public MapPosVectorVector 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.