Class Polygon

java.lang.Object
org.elasticsearch.geometry.Polygon
All Implemented Interfaces:
Geometry

public final class Polygon
extends java.lang.Object
implements Geometry
Represents a closed polygon on the earth's surface with optional holes
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static Polygon EMPTY  
  • Constructor Summary

    Constructors 
    Constructor Description
    Polygon​(LinearRing polygon)
    Creates a new Polygon from the supplied latitude/longitude array, and optionally any holes.
    Polygon​(LinearRing polygon, java.util.List<LinearRing> holes)
    Creates a new Polygon from the supplied latitude/longitude array, and optionally any holes.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    LinearRing getHole​(int i)  
    int getNumberOfHoles()  
    LinearRing getPolygon()  
    int hashCode()  
    boolean hasZ()  
    boolean isEmpty()  
    java.lang.String toString()  
    ShapeType type()  
    <T,​ E extends java.lang.Exception>
    T
    visit​(GeometryVisitor<T,​E> visitor)  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.elasticsearch.geometry.Geometry

    hasAlt
  • Field Details

  • Constructor Details

    • Polygon

      public Polygon​(LinearRing polygon, java.util.List<LinearRing> holes)
      Creates a new Polygon from the supplied latitude/longitude array, and optionally any holes.
    • Polygon

      public Polygon​(LinearRing polygon)
      Creates a new Polygon from the supplied latitude/longitude array, and optionally any holes.
  • Method Details

    • type

      public ShapeType type()
      Specified by:
      type in interface Geometry
    • getNumberOfHoles

      public int getNumberOfHoles()
    • getPolygon

      public LinearRing getPolygon()
    • getHole

      public LinearRing getHole​(int i)
    • visit

      public <T,​ E extends java.lang.Exception> T visit​(GeometryVisitor<T,​E> visitor) throws E extends java.lang.Exception
      Specified by:
      visit in interface Geometry
      Throws:
      E extends java.lang.Exception
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Geometry
    • hasZ

      public boolean hasZ()
      Specified by:
      hasZ in interface Geometry
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object