Package com.graphhopper.util.shapes
Class BBox
java.lang.Object
com.graphhopper.util.shapes.BBox
A simple bounding box defined as follows: minLon, maxLon followed by minLat which is south(!) and
maxLat. Equally to EX_GeographicBoundingBox in the ISO 19115 standard see
http://osgeo-org.1560.n6.nabble.com/Boundingbox-issue-for-discussion-td3875533.html
Nice German overview: http://www.geoinf.uni-jena.de/fileadmin/Geoinformatik/Lehre/Diplomarbeiten/DA_Andres.pdf
- Author:
- Peter Karich
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBBox(double[] coords) BBox(double minLon, double maxLon, double minLat, double maxLat) BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle) BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle, boolean elevation) -
Method Summary
Modifier and TypeMethodDescriptioncalculateIntersection(BBox bBox) Calculates the intersecting BBox between this and the specified BBoxclone()booleancontains(double lat, double lon) booleanstatic BBoxcreateInverse(boolean elevation) Prefills BBox with minimum values so that it can increase.booleanstatic BBoxfromEnvelope(org.locationtech.jts.geom.Envelope envelope) static BBoxfromPoints(double lat1, double lon1, double lat2, double lon2) booleaninthashCode()booleanintersects(double minLon, double maxLon, double minLat, double maxLat) This method calculates if this BBox intersects with the specified BBoxbooleanintersects(PointList pointList) booleanintersects(BBox o) This method calculates if this BBox intersects with the specified BBoxstatic booleanintersects(org.locationtech.jts.algorithm.RectangleLineIntersector intersector, PointList pointList) booleanisValid()static BBoxparseBBoxString(String objectAsString) This method creates a BBox out of a string in format lon1,lon2,lat1,lat2static BBoxparseTwoPoints(String objectAsString) This method creates a BBox out of a string in format lat1,lon1,lat2,lon2static org.locationtech.jts.geom.EnvelopetoEnvelope(BBox bbox) toString()voidupdate(double lat, double lon) voidupdate(double lat, double lon, double elev)
-
Field Details
-
minLon
public double minLon -
maxLon
public double maxLon -
minLat
public double minLat -
maxLat
public double maxLat -
minEle
public double minEle -
maxEle
public double maxEle
-
-
Constructor Details
-
BBox
public BBox(double[] coords) -
BBox
public BBox(double minLon, double maxLon, double minLat, double maxLat) -
BBox
public BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle) -
BBox
public BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle, boolean elevation)
-
-
Method Details
-
createInverse
Prefills BBox with minimum values so that it can increase. -
hasElevation
public boolean hasElevation() -
update
public void update(double lat, double lon) -
update
public void update(double lat, double lon, double elev) -
calculateIntersection
Calculates the intersecting BBox between this and the specified BBox- Returns:
- the intersecting BBox or null if not intersecting
-
clone
-
intersects
public static boolean intersects(org.locationtech.jts.algorithm.RectangleLineIntersector intersector, PointList pointList) -
intersects
- Specified by:
intersectsin interfaceShape
-
intersects
public boolean intersects(double minLon, double maxLon, double minLat, double maxLat) This method calculates if this BBox intersects with the specified BBox -
intersects
This method calculates if this BBox intersects with the specified BBox -
contains
public boolean contains(double lat, double lon) -
contains
-
toString
-
toLessPrecisionString
-
getBounds
-
equals
-
hashCode
public int hashCode() -
isValid
public boolean isValid() -
toGeoJson
- Returns:
- array containing this bounding box. Attention: GeoJson is lon,lat! If 3D is gets even worse: lon,lat,ele
-
fromEnvelope
-
toEnvelope
-
parseTwoPoints
This method creates a BBox out of a string in format lat1,lon1,lat2,lon2 -
fromPoints
-
parseBBoxString
This method creates a BBox out of a string in format lon1,lon2,lat1,lat2
-