Package org.elasticsearch.common.geo
Class GeoPoint
- java.lang.Object
-
- org.elasticsearch.common.geo.GeoPoint
-
- All Implemented Interfaces:
ToXContent
,ToXContentFragment
public final class GeoPoint extends java.lang.Object implements ToXContentFragment
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description static double
assertZValue(boolean ignoreZValue, double zValue)
boolean
equals(java.lang.Object o)
static GeoPoint
fromGeohash(long geohashLong)
static GeoPoint
fromGeohash(java.lang.String geohash)
java.lang.String
geohash()
java.lang.String
getGeohash()
double
getLat()
double
getLon()
int
hashCode()
double
lat()
double
lon()
static GeoPoint
parseFromLatLon(java.lang.String latLon)
GeoPoint
reset(double lat, double lon)
GeoPoint
resetFromGeoHash(long geohashLong)
GeoPoint
resetFromGeoHash(java.lang.String geohash)
GeoPoint
resetFromIndexableField(org.apache.lucene.index.IndexableField field)
GeoPoint
resetFromIndexHash(long hash)
GeoPoint
resetFromString(java.lang.String value)
GeoPoint
resetFromString(java.lang.String value, boolean ignoreZValue)
GeoPoint
resetLat(double lat)
GeoPoint
resetLon(double lon)
java.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
GeoPoint
public GeoPoint()
-
GeoPoint
public GeoPoint(java.lang.String value)
Create a new Geopoint from a string. This String must either be a geohash or a lat-lon tuple.- Parameters:
value
- String to create the point from
-
GeoPoint
public GeoPoint(double lat, double lon)
-
GeoPoint
public GeoPoint(GeoPoint template)
-
-
Method Detail
-
reset
public GeoPoint reset(double lat, double lon)
-
resetLat
public GeoPoint resetLat(double lat)
-
resetLon
public GeoPoint resetLon(double lon)
-
resetFromString
public GeoPoint resetFromString(java.lang.String value)
-
resetFromString
public GeoPoint resetFromString(java.lang.String value, boolean ignoreZValue)
-
resetFromIndexHash
public GeoPoint resetFromIndexHash(long hash)
-
resetFromIndexableField
public GeoPoint resetFromIndexableField(org.apache.lucene.index.IndexableField field)
-
resetFromGeoHash
public GeoPoint resetFromGeoHash(java.lang.String geohash)
-
resetFromGeoHash
public GeoPoint resetFromGeoHash(long geohashLong)
-
lat
public double lat()
-
getLat
public double getLat()
-
lon
public double lon()
-
getLon
public double getLon()
-
geohash
public java.lang.String geohash()
-
getGeohash
public java.lang.String getGeohash()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
parseFromLatLon
public static GeoPoint parseFromLatLon(java.lang.String latLon)
-
fromGeohash
public static GeoPoint fromGeohash(java.lang.String geohash)
-
fromGeohash
public static GeoPoint fromGeohash(long geohashLong)
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
assertZValue
public static double assertZValue(boolean ignoreZValue, double zValue)
-
-