|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.index.search.geo.GeoUtils
public class GeoUtils
Constructor Summary | |
---|---|
GeoUtils()
|
Method Summary | |
---|---|
static double |
normalizeLat(double lat)
Normalize latitude to lie within the -90 to 90 (both inclusive) range. |
static double |
normalizeLon(double lon)
Normalize longitude to lie within the -180 (exclusive) to 180 (inclusive) range. |
static void |
normalizePoint(Point point)
Normalize the geo Point for its coordinates to lie within their
respective normalized ranges. |
static void |
normalizePoint(Point point,
boolean normLat,
boolean normLon)
Normalize the geo Point for the given coordinates to lie within
their respective normalized ranges. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeoUtils()
Method Detail |
---|
public static double normalizeLon(double lon)
lon
- Longitude to normalize
normalizePoint(Point)
public static double normalizeLat(double lat)
Note: You should not normalize longitude and latitude separately,
because when normalizing latitude it may be necessary to
add a shift of 180° in the longitude.
For this purpose, you should call the
normalizePoint(Point)
function.
lat
- Latitude to normalize
normalizePoint(Point)
public static void normalizePoint(Point point)
Point
for its coordinates to lie within their
respective normalized ranges.
Note: A shift of 180° is applied in the longitude if necessary, in order to normalize properly the latitude.
point
- The point to normalize in-place.public static void normalizePoint(Point point, boolean normLat, boolean normLon)
Point
for the given coordinates to lie within
their respective normalized ranges.
You can control which coordinate gets normalized with the two flags.
Note: A shift of 180° is applied in the longitude if necessary, in order to normalize properly the latitude. If normalizing latitude but not longitude, it is assumed that the longitude is in the form x+k*360, with x in ]-180;180], and k is meaningful to the application. Therefore x will be adjusted while keeping k preserved.
point
- The point to normalize in-place.normLat
- Whether to normalize latitude or leave it as is.normLon
- Whether to normalize longitude.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |