Class Rectangle

  • All Implemented Interfaces:
    Geometry

    public class Rectangle
    extends java.lang.Object
    implements Geometry
    Represents a lat/lon rectangle in decimal degrees and optional altitude in meters.
    • Field Summary

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

      Constructors 
      Constructor Description
      Rectangle​(double minLat, double maxLat, double minLon, double maxLon)
      Constructs a bounding box by first validating the provided latitude and longitude coordinates
      Rectangle​(double minLat, double maxLat, double minLon, double maxLon, double minAlt, double maxAlt)
      Constructs a bounding box by first validating the provided latitude and longitude coordinates
    • Method Summary

      Modifier and Type Method Description
      boolean containsPoint​(double lat, double lon)
      returns true if rectangle (defined by minLat, maxLat, minLon, maxLon) contains the lat lon point
      boolean crossesDateline()
      Returns true if this bounding box crosses the dateline
      boolean equals​(java.lang.Object o)  
      double getHeight()  
      double getMaxAlt()  
      double getMaxLat()  
      double getMaxLon()  
      double getMinAlt()  
      double getMinLat()  
      double getMinLon()  
      double getWidth()  
      boolean hasAlt()  
      int hashCode()  
      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
    • Field Detail

    • Constructor Detail

      • Rectangle

        public Rectangle​(double minLat,
                         double maxLat,
                         double minLon,
                         double maxLon)
        Constructs a bounding box by first validating the provided latitude and longitude coordinates
      • Rectangle

        public Rectangle​(double minLat,
                         double maxLat,
                         double minLon,
                         double maxLon,
                         double minAlt,
                         double maxAlt)
        Constructs a bounding box by first validating the provided latitude and longitude coordinates
    • Method Detail

      • getWidth

        public double getWidth()
      • getHeight

        public double getHeight()
      • getMinLat

        public double getMinLat()
      • getMinLon

        public double getMinLon()
      • getMinAlt

        public double getMinAlt()
      • getMaxLat

        public double getMaxLat()
      • getMaxLon

        public double getMaxLon()
      • getMaxAlt

        public double getMaxAlt()
      • toString

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

        public boolean crossesDateline()
        Returns true if this bounding box crosses the dateline
      • containsPoint

        public boolean containsPoint​(double lat,
                                     double lon)
        returns true if rectangle (defined by minLat, maxLat, minLon, maxLon) contains the lat lon point
      • 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
      • 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
      • hasAlt

        public boolean hasAlt()
        Specified by:
        hasAlt in interface Geometry