Class GeoPoint

java.lang.Object
org.elasticsearch.common.geo.GeoPoint
All Implemented Interfaces:
Comparable<SpatialPoint>, SpatialPoint, ToXContent, ToXContentFragment

public final class GeoPoint extends Object implements SpatialPoint, ToXContentFragment
  • Constructor Details

    • GeoPoint

      public GeoPoint()
    • GeoPoint

      public GeoPoint(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(SpatialPoint template)
  • Method Details

    • reset

      public GeoPoint reset(double lat, double lon)
    • resetLat

      public GeoPoint resetLat(double lat)
    • resetLon

      public GeoPoint resetLon(double lon)
    • resetFromString

      public GeoPoint resetFromString(String value)
    • resetFromString

      public GeoPoint resetFromString(String value, boolean ignoreZValue, GeoUtils.EffectivePoint effectivePoint)
    • resetFromCoordinates

      public GeoPoint resetFromCoordinates(String value, boolean ignoreZValue)
    • resetFromIndexHash

      public GeoPoint resetFromIndexHash(long hash)
    • resetFromGeoHash

      public GeoPoint resetFromGeoHash(String geohash)
    • resetFromGeoHash

      public GeoPoint resetFromGeoHash(long geohashLong)
    • lat

      public double lat()
    • getLat

      public double getLat()
    • lon

      public double lon()
    • getLon

      public double getLon()
    • getX

      public double getX()
      Specified by:
      getX in interface SpatialPoint
    • getY

      public double getY()
      Specified by:
      getY in interface SpatialPoint
    • geohash

      public String geohash()
    • getGeohash

      public String getGeohash()
    • getEncoded

      public long getEncoded()
      Return the point in Lucene encoded format used to stored points as doc values
    • resetFromEncoded

      public GeoPoint resetFromEncoded(long encoded)
      reset the point using Lucene encoded format used to stored points as doc values
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromGeohash

      public static GeoPoint fromGeohash(String geohash)
    • fromGeohash

      public static GeoPoint fromGeohash(long geohashLong)
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • assertZValue

      public static double assertZValue(boolean ignoreZValue, double zValue)