Package mil.nga.grid.features
Class Bounds
- java.lang.Object
 - 
- mil.nga.sf.GeometryEnvelope
 - 
- mil.nga.grid.features.Bounds
 
 
 
- 
- All Implemented Interfaces:
 Serializable
public class Bounds extends GeometryEnvelope
Grid Bounds- Author:
 - osbornb
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description Bounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)ConstructorBounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, Unit unit)ConstructorBounds(Bounds bounds)Copy constructorBounds(Point southwest, Point northeast)ConstructorBounds(GeometryEnvelope envelope, Unit unit)Constructor 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Boundsbounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, Unit unit)Create boundsstatic Boundsbounds(Bounds bounds)Copy boundsstatic Boundsbounds(Point southwest, Point northeast)Create boundsstatic Boundsbounds(GeometryEnvelope envelope, Unit unit)Create boundsBoundscopy()Copy the boundsstatic Boundsdegrees(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)Create bounds in degreesbooleanequals(Object obj)PointgetCentroid()doublegetCentroidLatitude()Get the centroid latitudedoublegetCentroidLongitude()Get the centroid longitudedoublegetEast()Get the eastern longitudeLinegetEastLine()Get the eastern linedoublegetHeight()Get the heightList<Line>getLines()Get the four line bounds in metersdoublegetMaxLatitude()Get the max latitudedoublegetMaxLongitude()Get the max longitudedoublegetMinLatitude()Get the min latitudedoublegetMinLongitude()Get the min longitudedoublegetNorth()Get the northern latitudePointgetNortheast()Get the northeast coordinateLinegetNorthLine()Get the northern linePointgetNorthwest()Get the northwest coordinatePixelRangegetPixelRange(int width, int height, Bounds bounds)Get the pixel range where the bounds fit into the provided boundsPixelRangegetPixelRange(GridTile tile)Get the pixel range where the bounds fit into the tiledoublegetSouth()Get the southern latitudePointgetSoutheast()Get the southeast coordinateLinegetSouthLine()Get the southern linePointgetSouthwest()Get the southwest coordinateUnitgetUnit()Get the unitdoublegetWest()Get the western longitudeLinegetWestLine()Get the western linedoublegetWidth()Get the widthinthashCode()booleanisDegrees()Are bounds in degreesbooleanisMeters()Are bounds in metersbooleanisUnit(Unit unit)Is in the provided unit typestatic Boundsmeters(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)Create bounds in metersBoundsoverlap(Bounds bounds)Create a new bounds as the overlapping between this bounds and the providedvoidsetEast(double east)Set the eastern longitudevoidsetMaxLatitude(double maxLatitude)Set the max latitudevoidsetMaxLongitude(double maxLongitude)Set the max longitudevoidsetMinLatitude(double minLatitude)Set the min latitudevoidsetMinLongitude(double minLongitude)Set the min longitudevoidsetNorth(double north)Set the northern latitudevoidsetSouth(double south)Set the southern latitudevoidsetUnit(Unit unit)Set the unitvoidsetWest(double west)Set the western longitudeBoundstoDegrees()Convert to degreesBoundstoMeters()Convert to metersBoundstoPrecision(double precision)Convert the bounds to be precision accurate minimally containing the bounds.BoundstoUnit(Unit unit)Convert to the unitBoundsunion(Bounds bounds)Create a new bounds as the union between this bounds and the provided- 
Methods inherited from class mil.nga.sf.GeometryEnvelope
buildGeometry, contains, contains, contains, contains, contains, contains, getBottom, getBottomLeft, getBottomMid, getBottomRight, getLeft, getLeftMid, getMaxM, getMaxX, getMaxY, getMaxZ, getMidX, getMidY, getMinM, getMinX, getMinY, getMinZ, getMRange, getRight, getRightMid, getTop, getTopLeft, getTopMid, getTopRight, getXRange, getYRange, getZRange, hasM, hasZ, intersects, intersects, is3D, isEmpty, isHasM, isHasZ, isMeasured, isPoint, overlap, overlap, setHasM, setHasZ, setMaxM, setMaxX, setMaxY, setMaxZ, setMinM, setMinX, setMinY, setMinZ, union 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
Bounds
public Bounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)Constructor- Parameters:
 minLongitude- min longitudeminLatitude- min latitudemaxLongitude- max longitudemaxLatitude- max latitude
 
- 
Bounds
public Bounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, Unit unit)Constructor- Parameters:
 minLongitude- min longitudeminLatitude- min latitudemaxLongitude- max longitudemaxLatitude- max latitudeunit- unit
 
- 
Bounds
public Bounds(Point southwest, Point northeast)
Constructor- Parameters:
 southwest- southwest cornernortheast- 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 envelopeunit- unit
 
 - 
 
- 
Method Detail
- 
bounds
public static Bounds bounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude, Unit unit)
Create bounds- Parameters:
 minLongitude- min longitudeminLatitude- min latitudemaxLongitude- max longitudemaxLatitude- max latitudeunit- unit- Returns:
 - bounds
 
 
- 
degrees
public static Bounds degrees(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)
Create bounds in degrees- Parameters:
 minLongitude- min longitudeminLatitude- min latitudemaxLongitude- max longitudemaxLatitude- max latitude- Returns:
 - bounds
 
 
- 
meters
public static Bounds meters(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)
Create bounds in meters- Parameters:
 minLongitude- min longitudeminLatitude- min latitudemaxLongitude- max longitudemaxLatitude- max latitude- Returns:
 - bounds
 
 
- 
bounds
public static Bounds bounds(Point southwest, Point northeast)
Create bounds- Parameters:
 southwest- southwest cornernortheast- 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 envelopeunit- 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
 
 
- 
getCentroid
public Point getCentroid()
- Overrides:
 getCentroidin classGeometryEnvelope
 
- 
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- widthheight- heightbounds- bounds- Returns:
 - pixel range
 
 
- 
copy
public Bounds copy()
Copy the bounds- Overrides:
 copyin classGeometryEnvelope- Returns:
 - bounds copy
 
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classGeometryEnvelope
 
- 
equals
public boolean equals(Object obj)
- Overrides:
 equalsin classGeometryEnvelope
 
 - 
 
 -