public class GeoBox extends Object
Defined by n,s,e,w values lat/lon.
Use the getSafe* methods to ensure that values are in range.
| Constructor and Description |
|---|
GeoBox(Double n,
Double e,
Double s,
Double w) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(double lat,
double lon)
Does the box contain the point (inclusive)
|
double |
getSafeE()
Gets a valid value on ES, limited to 180 degrees longitude.
|
double |
getSafeN()
Gets a valid value on N, limited to 90 degrees latitude.
|
double |
getSafeS()
Gets a valid value on S, limited to -90 degrees latitude.
|
double |
getSafeW()
Gets a valid value on W, limited to -180 degrees longitude.
|
static GeoBox |
globe()
The entire globe.
|
GeoBox |
intersection(GeoBox geobox)
Calculate the intersection this box with another.
|
boolean |
isValid()
Checks if is valid.
|
public double getSafeN()
public double getSafeS()
public double getSafeE()
public double getSafeW()
public boolean contains(double lat,
double lon)
lat - the latlon - the lonpublic boolean isValid()
This means that the raw (constructor provided) values are valid. Note that the output defined by getSafe* will always be safe/valid for use.
public GeoBox intersection(GeoBox geobox)
geobox - the geoboxpublic static final GeoBox globe()
Use for search everywhere.
Copyright © 2017–2018 Committed. All rights reserved.