org.apache.lucene.spatial.geopoint.document

## Class GeoPointField

- java.lang.Object
- - org.apache.lucene.document.Field
  - - org.apache.lucene.spatial.geopoint.document.GeoPointField

- All Implemented Interfaces:
    IndexableField

  Deprecated.
  Use the higher performance `LatLonPoint` instead.

      @Deprecated
      public final class GeoPointField
      extends Field

  Field that indexes `latitude` `longitude` decimal-degree values for efficient encoding, sorting, and querying. This Geo capability is intended to provide a basic and efficient out of the box field type for indexing and querying 2 dimensional points in WGS-84 decimal degrees. An example usage is as follows:

        document.add(new GeoPointField(name, -96.33, 32.66, Field.Store.NO));

  To perform simple geospatial queries against a `GeoPointField`, see `GeoPointInBBoxQuery`, `GeoPointInPolygonQuery`, or `GeoPointDistanceQuery` NOTE: This indexes only high precision encoded terms which may result in visiting a high number of terms for large queries. See LUCENE-6481 for a future improvement.

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GeoPointField.TermEncoding` Deprecated. Expert: Optional flag to select term encoding for GeoPointField types

    - ### Nested classes/interfaces inherited from class org.apache.lucene.document.Field

      `Field.Store`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static short` | `BITS` Deprecated. number of bits used for quantizing latitude and longitude values
    `static FieldType` | `NUMERIC_TYPE_NOT_STORED` Deprecated. Type for a GeoPointField that is not stored: normalization factors, frequencies, and positions are omitted.
    `static FieldType` | `NUMERIC_TYPE_STORED` Deprecated. Type for a stored GeoPointField: normalization factors, frequencies, and positions are omitted.
    `static int` | `PRECISION_STEP` Deprecated. encoding step value for GeoPoint prefix terms
    `static FieldType` | `PREFIX_TYPE_NOT_STORED` Deprecated. Type for a GeoPointField that is not stored: normalization factors, frequencies, and positions are omitted.
    `static FieldType` | `PREFIX_TYPE_STORED` Deprecated. Type for a stored GeoPointField: normalization factors, frequencies, and positions are omitted.

    - ### Fields inherited from class org.apache.lucene.document.Field

      `boost, fieldsData, name, tokenStream, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoPointField(String name, double latitude, double longitude, Field.Store stored)` Deprecated. Creates a stored or un-stored GeoPointField
    `GeoPointField(String name, double latitude, double longitude, FieldType type)` Deprecated. Expert: allows you to customize the `FieldType`.
    `GeoPointField(String name, double latitude, double longitude, GeoPointField.TermEncoding termEncoding, Field.Store stored)` Deprecated.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `decodeLatitude(long hash)` Deprecated. decode latitude value from morton encoded geo point
    `static double` | `decodeLongitude(long hash)` Deprecated. decode longitude value from morton encoded geo point
    `static long` | `encodeLatLon(double lat, double lon)` Deprecated. 31 bit encoding utils *
    `static void` | `geoCodedToPrefixCoded(long hash, int shift, BytesRefBuilder bytes)` Deprecated. Convert a geocoded morton long into a prefix coded geo term
    `double` | `getLat()` Deprecated. access latitude value
    `double` | `getLon()` Deprecated. access longitude value
    `static int` | `getPrefixCodedShift(BytesRef val)` Deprecated. Get the prefix coded geo term shift value
    `static long` | `prefixCodedToGeoCoded(BytesRef val)` Deprecated. Convert a prefix coded geo term back into the geocoded morton long
    `TokenStream` | `tokenStream(Analyzer analyzer, TokenStream reuse)` Deprecated.
    `String` | `toString()` Deprecated.

    - ### Methods inherited from class org.apache.lucene.document.Field

      `binaryValue, boost, fieldType, name, numericValue, readerValue, setBoost, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStreamValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PRECISION_STEP

          public static final int PRECISION_STEP

      Deprecated.
      encoding step value for GeoPoint prefix terms
      See Also:
        Constant Field Values

    - #### BITS

          public static final short BITS

      Deprecated.
      number of bits used for quantizing latitude and longitude values
      See Also:
        Constant Field Values

    - #### NUMERIC_TYPE_NOT_STORED

          @Deprecated
          public static final FieldType NUMERIC_TYPE_NOT_STORED

      Deprecated. Type for a GeoPointField that is not stored: normalization factors, frequencies, and positions are omitted.

    - #### NUMERIC_TYPE_STORED

          @Deprecated
          public static final FieldType NUMERIC_TYPE_STORED

      Deprecated. Type for a stored GeoPointField: normalization factors, frequencies, and positions are omitted.

    - #### PREFIX_TYPE_NOT_STORED

          public static final FieldType PREFIX_TYPE_NOT_STORED

      Deprecated.
      Type for a GeoPointField that is not stored: normalization factors, frequencies, and positions are omitted.

    - #### PREFIX_TYPE_STORED

          public static final FieldType PREFIX_TYPE_STORED

      Deprecated.
      Type for a stored GeoPointField: normalization factors, frequencies, and positions are omitted.

  - ### Constructor Detail

    - #### GeoPointField

          public GeoPointField(String name,
                               double latitude,
                               double longitude,
                               Field.Store stored)

      Deprecated.
      Creates a stored or un-stored GeoPointField
      Parameters:
        `name` - field name
        `latitude` - latitude double value [-90.0 : 90.0]
        `longitude` - longitude double value [-180.0 : 180.0]
        `stored` - Store.YES if the content should also be stored
      Throws:
        `IllegalArgumentException` - if the field name is null.

    - #### GeoPointField

          @Deprecated
          public GeoPointField(String name,
                                           double latitude,
                                           double longitude,
                                           GeoPointField.TermEncoding termEncoding,
                                           Field.Store stored)

      Deprecated.
      Creates a stored or un-stored GeoPointField using the specified `GeoPointField.TermEncoding` method
      Parameters:
        `name` - field name
        `latitude` - latitude double value [-90.0 : 90.0]
        `longitude` - longitude double value [-180.0 : 180.0]
        `termEncoding` - encoding type to use (`GeoPointField.TermEncoding.NUMERIC` Terms, or `GeoPointField.TermEncoding.PREFIX` only Terms)
        `stored` - Store.YES if the content should also be stored
      Throws:
        `IllegalArgumentException` - if the field name is null.

    - #### GeoPointField

          public GeoPointField(String name,
                               double latitude,
                               double longitude,
                               FieldType type)

      Deprecated.
      Expert: allows you to customize the `FieldType`.
      Parameters:
        `name` - field name
        `latitude` - latitude double value [-90.0 : 90.0]
        `longitude` - longitude double value [-180.0 : 180.0]
        `type` - customized field type: must have `FieldType.numericType()` of `FieldType.LegacyNumericType.LONG`.
      Throws:
        `IllegalArgumentException` - if the field name or type is null, or if the field type does not have a LONG numericType()

  - ### Method Detail

    - #### tokenStream

          public TokenStream tokenStream(Analyzer analyzer,
                                         TokenStream reuse)

      Deprecated.
      Specified by:
        `tokenStream` in interface `IndexableField`
      Overrides:
        `tokenStream` in class `Field`

    - #### getLat

          public double getLat()

      Deprecated.
      access latitude value

    - #### getLon

          public double getLon()

      Deprecated.
      access longitude value

    - #### toString

          public String toString()

      Deprecated.
      Overrides:
        `toString` in class `Field`

    - #### encodeLatLon

          public static long encodeLatLon(double lat,
                                          double lon)

      Deprecated.
      31 bit encoding utils *

    - #### decodeLongitude

          public static final double decodeLongitude(long hash)

      Deprecated.
      decode longitude value from morton encoded geo point

    - #### decodeLatitude

          public static final double decodeLatitude(long hash)

      Deprecated.
      decode latitude value from morton encoded geo point

    - #### geoCodedToPrefixCoded

          public static void geoCodedToPrefixCoded(long hash,
                                                   int shift,
                                                   BytesRefBuilder bytes)

      Deprecated.
      Convert a geocoded morton long into a prefix coded geo term

    - #### prefixCodedToGeoCoded

          public static long prefixCodedToGeoCoded(BytesRef val)

      Deprecated.
      Convert a prefix coded geo term back into the geocoded morton long

    - #### getPrefixCodedShift

          public static int getPrefixCodedShift(BytesRef val)

      Deprecated.
      Get the prefix coded geo term shift value

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.