Class MultiGeometry

java.lang.Object
com.massifmaps.geometry.Geometry
com.massifmaps.geometry.MultiGeometry
Direct Known Subclasses:
MultiLineGeometry, MultiPointGeometry, MultiPolygonGeometry

public class MultiGeometry extends Geometry
A generic multi geometry container.
  • Constructor Details

    • MultiGeometry

      public MultiGeometry(GeometryVector geometries)
      Constructs a MultiGeometry from a vector of geometry objects.
      Parameters:
      geometries - The geometries for multi geometry.
  • 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.
    • getGeometryCount

      public int getGeometryCount()
      Returns the number of geometry objects in this multi geometry container.
      Returns:
      The number of geometry objects.
    • getGeometry

      public Geometry getGeometry(int index)
      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.