Package org.elasticsearch.common.geo
Class GeoPoint
java.lang.Object
org.elasticsearch.common.geo.GeoPoint
- All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
- Direct Known Subclasses:
GeoPointFieldMapper.ParsedGeoPoint
public class GeoPoint
extends java.lang.Object
implements org.elasticsearch.common.xcontent.ToXContentFragment
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static doubleassertZValue(boolean ignoreZValue, double zValue)booleanequals(java.lang.Object o)static GeoPointfromGeohash(long geohashLong)static GeoPointfromGeohash(java.lang.String geohash)java.lang.Stringgeohash()java.lang.StringgetGeohash()doublegetLat()doublegetLon()inthashCode()doublelat()doublelon()GeoPointreset(double lat, double lon)GeoPointresetFromCoordinates(java.lang.String value, boolean ignoreZValue)GeoPointresetFromGeoHash(long geohashLong)GeoPointresetFromGeoHash(java.lang.String geohash)GeoPointresetFromIndexableField(org.apache.lucene.index.IndexableField field)GeoPointresetFromIndexHash(long hash)GeoPointresetFromString(java.lang.String value)GeoPointresetFromString(java.lang.String value, boolean ignoreZValue, GeoUtils.EffectivePoint effectivePoint)GeoPointresetLat(double lat)GeoPointresetLon(double lon)java.lang.StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
lat
protected double lat -
lon
protected double lon
-
-
Constructor Details
-
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
-
-
Method Details
-
reset
-
resetLat
-
resetLon
-
resetFromString
-
resetFromString
public GeoPoint resetFromString(java.lang.String value, boolean ignoreZValue, GeoUtils.EffectivePoint effectivePoint) -
resetFromCoordinates
-
resetFromIndexHash
-
resetFromIndexableField
-
resetFromGeoHash
-
resetFromGeoHash
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
fromGeohash
-
fromGeohash
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
assertZValue
public static double assertZValue(boolean ignoreZValue, double zValue)
-