Class PolygonCoordinates

java.lang.Object
com.mongodb.client.model.geojson.PolygonCoordinates

public final class PolygonCoordinates extends Object
Coordinates for a GeoJSON Polygon.
Since:
3.1
  • Constructor Details

    • PolygonCoordinates

      @SafeVarargs public PolygonCoordinates(List<Position> exterior, List<Position>... holes)
      Construct an instance.
      Parameters:
      exterior - the exterior ring of the polygon
      holes - optional interior rings of the polygon
    • PolygonCoordinates

      public PolygonCoordinates(List<Position> exterior, List<List<Position>> holes)
      Construct an instance.
      Parameters:
      exterior - the exterior ring of the polygon
      holes - optional interior rings of the polygon
      Since:
      4.3
  • Method Details

    • getExterior

      public List<Position> getExterior()
      Gets the exterior of the polygon.
      Returns:
      the exterior of the polygon
    • getHoles

      public List<List<Position>> getHoles()
      Gets the holes in the polygon.
      Returns:
      the holes in the polygon, which will not be null but may be empty
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object