Class Bounds

    • Constructor Detail

      • Bounds

        public Bounds​(double minLongitude,
                      double minLatitude,
                      double maxLongitude,
                      double maxLatitude)
        Constructor
        Parameters:
        minLongitude - min longitude
        minLatitude - min latitude
        maxLongitude - max longitude
        maxLatitude - max latitude
      • Bounds

        public Bounds​(double minLongitude,
                      double minLatitude,
                      double maxLongitude,
                      double maxLatitude,
                      Unit unit)
        Constructor
        Parameters:
        minLongitude - min longitude
        minLatitude - min latitude
        maxLongitude - max longitude
        maxLatitude - max latitude
        unit - unit
      • Bounds

        public Bounds​(Point southwest,
                      Point northeast)
        Constructor
        Parameters:
        southwest - southwest corner
        northeast - northeast corner
      • Bounds

        public Bounds​(Bounds bounds)
        Copy constructor
        Parameters:
        bounds - bounds to copy
      • Bounds

        public Bounds​(GeometryEnvelope envelope,
                      Unit unit)
        Constructor
        Parameters:
        envelope - geometry envelope
        unit - unit
    • Method Detail

      • bounds

        public static Bounds bounds​(double minLongitude,
                                    double minLatitude,
                                    double maxLongitude,
                                    double maxLatitude,
                                    Unit unit)
        Create bounds
        Parameters:
        minLongitude - min longitude
        minLatitude - min latitude
        maxLongitude - max longitude
        maxLatitude - max latitude
        unit - unit
        Returns:
        bounds
      • degrees

        public static Bounds degrees​(double minLongitude,
                                     double minLatitude,
                                     double maxLongitude,
                                     double maxLatitude)
        Create bounds in degrees
        Parameters:
        minLongitude - min longitude
        minLatitude - min latitude
        maxLongitude - max longitude
        maxLatitude - max latitude
        Returns:
        bounds
      • meters

        public static Bounds meters​(double minLongitude,
                                    double minLatitude,
                                    double maxLongitude,
                                    double maxLatitude)
        Create bounds in meters
        Parameters:
        minLongitude - min longitude
        minLatitude - min latitude
        maxLongitude - max longitude
        maxLatitude - max latitude
        Returns:
        bounds
      • bounds

        public static Bounds bounds​(Point southwest,
                                    Point northeast)
        Create bounds
        Parameters:
        southwest - southwest corner
        northeast - northeast corner
        Returns:
        bounds
      • bounds

        public static Bounds bounds​(Bounds bounds)
        Copy bounds
        Parameters:
        bounds - bounds to copy
        Returns:
        bounds
      • bounds

        public static Bounds bounds​(GeometryEnvelope envelope,
                                    Unit unit)
        Create bounds
        Parameters:
        envelope - geometry envelope
        unit - unit
        Returns:
        bounds
      • getMinLongitude

        public double getMinLongitude()
        Get the min longitude
        Returns:
        min longitude
      • setMinLongitude

        public void setMinLongitude​(double minLongitude)
        Set the min longitude
        Parameters:
        minLongitude - min longitude
      • getMinLatitude

        public double getMinLatitude()
        Get the min latitude
        Returns:
        min latitude
      • setMinLatitude

        public void setMinLatitude​(double minLatitude)
        Set the min latitude
        Parameters:
        minLatitude - min latitude
      • getMaxLongitude

        public double getMaxLongitude()
        Get the max longitude
        Returns:
        max longitude
      • setMaxLongitude

        public void setMaxLongitude​(double maxLongitude)
        Set the max longitude
        Parameters:
        maxLongitude - max longitude
      • getMaxLatitude

        public double getMaxLatitude()
        Get the max latitude
        Returns:
        max latitude
      • setMaxLatitude

        public void setMaxLatitude​(double maxLatitude)
        Set the max latitude
        Parameters:
        maxLatitude - max latitude
      • getWest

        public double getWest()
        Get the western longitude
        Returns:
        western longitude
      • setWest

        public void setWest​(double west)
        Set the western longitude
        Parameters:
        west - western longitude
      • getSouth

        public double getSouth()
        Get the southern latitude
        Returns:
        southern latitude
      • setSouth

        public void setSouth​(double south)
        Set the southern latitude
        Parameters:
        south - southern latitude
      • getEast

        public double getEast()
        Get the eastern longitude
        Returns:
        eastern longitude
      • setEast

        public void setEast​(double east)
        Set the eastern longitude
        Parameters:
        east - eastern longitude
      • getNorth

        public double getNorth()
        Get the northern latitude
        Returns:
        northern latitude
      • setNorth

        public void setNorth​(double north)
        Set the northern latitude
        Parameters:
        north - northern latitude
      • getUnit

        public Unit getUnit()
        Get the unit
        Returns:
        unit
      • setUnit

        public void setUnit​(Unit unit)
        Set the unit
        Parameters:
        unit - unit
      • isUnit

        public boolean isUnit​(Unit unit)
        Is in the provided unit type
        Parameters:
        unit - unit
        Returns:
        true if in the unit
      • isDegrees

        public boolean isDegrees()
        Are bounds in degrees
        Returns:
        true if degrees
      • isMeters

        public boolean isMeters()
        Are bounds in meters
        Returns:
        true if meters
      • toUnit

        public Bounds toUnit​(Unit unit)
        Convert to the unit
        Parameters:
        unit - unit
        Returns:
        bounds in units, same bounds if equal units
      • toDegrees

        public Bounds toDegrees()
        Convert to degrees
        Returns:
        bounds in degrees, same bounds if already in degrees
      • toMeters

        public Bounds toMeters()
        Convert to meters
        Returns:
        bounds in meters, same bounds if already in meters
      • getCentroidLongitude

        public double getCentroidLongitude()
        Get the centroid longitude
        Returns:
        centroid longitude
      • getCentroidLatitude

        public double getCentroidLatitude()
        Get the centroid latitude
        Returns:
        centroid latitude
      • getWidth

        public double getWidth()
        Get the width
        Returns:
        width
      • getHeight

        public double getHeight()
        Get the height
        Returns:
        height
      • getSouthwest

        public Point getSouthwest()
        Get the southwest coordinate
        Returns:
        southwest coordinate
      • getNorthwest

        public Point getNorthwest()
        Get the northwest coordinate
        Returns:
        northwest coordinate
      • getSoutheast

        public Point getSoutheast()
        Get the southeast coordinate
        Returns:
        southeast coordinate
      • getNortheast

        public Point getNortheast()
        Get the northeast coordinate
        Returns:
        northeast coordinate
      • overlap

        public Bounds overlap​(Bounds bounds)
        Create a new bounds as the overlapping between this bounds and the provided
        Parameters:
        bounds - bounds
        Returns:
        overlap bounds
      • union

        public Bounds union​(Bounds bounds)
        Create a new bounds as the union between this bounds and the provided
        Parameters:
        bounds - bounds
        Returns:
        union bounds
      • getWestLine

        public Line getWestLine()
        Get the western line
        Returns:
        west line
      • getSouthLine

        public Line getSouthLine()
        Get the southern line
        Returns:
        south line
      • getEastLine

        public Line getEastLine()
        Get the eastern line
        Returns:
        east line
      • getNorthLine

        public Line getNorthLine()
        Get the northern line
        Returns:
        north line
      • toPrecision

        public Bounds toPrecision​(double precision)
        Convert the bounds to be precision accurate minimally containing the bounds. Each bound is equal to or larger by the precision degree amount.
        Parameters:
        precision - precision in degrees
        Returns:
        precision bounds
      • getPixelRange

        public PixelRange getPixelRange​(GridTile tile)
        Get the pixel range where the bounds fit into the tile
        Parameters:
        tile - tile
        Returns:
        pixel range
      • getPixelRange

        public PixelRange getPixelRange​(int width,
                                        int height,
                                        Bounds bounds)
        Get the pixel range where the bounds fit into the provided bounds
        Parameters:
        width - width
        height - height
        bounds - bounds
        Returns:
        pixel range
      • getLines

        public List<Line> getLines()
        Get the four line bounds in meters
        Returns:
        lines