Class 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.
    • Field Detail

      • EMPTY

        public static final Polygon EMPTY
    • Constructor Detail

      • 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 Detail

      • getNumberOfHoles

        public int getNumberOfHoles()
      • 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