LatLonShapeDocValuesField (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.document, class: LatLonShapeDocValuesField

Package org.apache.lucene.document

# Class LatLonShapeDocValuesField

java.lang.Object
org.apache.lucene.document.Field
org.apache.lucene.document.ShapeDocValuesField
org.apache.lucene.document.LatLonShapeDocValuesField

All Implemented Interfaces:
  `IndexableField`

public final class LatLonShapeDocValuesField extends ShapeDocValuesField
Concrete implementation of a `ShapeDocValuesField` for geographic geometries.

This field should be instantiated through `LatLonShape.createDocValueField(String, Line)`

- `LatLonShape.createDocValueField(String, Polygon)` for indexing a geographic polygon doc value field.
- `LatLonShape.createDocValueField(String, Line)` for indexing a geographic linestring doc value.
- `LatLonShape.createDocValueField(String, double, double)` for indexing a lat, lon geographic point doc value.
- `LatLonShape.createDocValueField(String, List)` for indexing a geographic doc value from a precomputed tessellation.
- `LatLonShape.createDocValueField(String, BytesRef)` for indexing a geographic doc value from existing encoding.

WARNING: Like `LatLonShape`, vertex values are indexed with some loss of precision from the original `double` values.

See Also:
  - `PointValues`
  - `LatLonDocValuesField`
WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Nested Class Summary

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

  `Field.Store`

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.document.ShapeDocValuesField

  `FIELD_TYPE, shapeDocValues`

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

  `fieldsData, name, type`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `LatLonShapeDocValuesField(String name, List<ShapeField.DecodedTriangle> tessellation)`
  constructs a `LatLonShapeDocValueField` from a pre-tessellated geometry
  `protected`
  `LatLonShapeDocValuesField(String name, BytesRef binaryValue)`
  Creates a `LatLonShapeDocValueField` from a given serialized value

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected double`
  `decodeX(int encoded)`
  decodes x coordinates from encoded space
  `protected double`
  `decodeY(int encoded)`
  decodes y coordinates from encoded space
  `Rectangle`
  `getBoundingBox()`
  retrieves the bounding box for the geometry
  `Point`
  `getCentroid()`
  retrieves the centroid location for the geometry

  ### Methods inherited from class org.apache.lucene.document.ShapeDocValuesField

  `fieldType, getHighestDimensionType, name, newGeometryQuery, numberOfTerms, stringValue, tokenStream`

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

  `binaryValue, getCharSequenceValue, invertableType, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, tokenStreamValue, toString`

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

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

- ## Constructor Details

  - ### LatLonShapeDocValuesField

    protected LatLonShapeDocValuesField(String name, List<ShapeField.DecodedTriangle> tessellation)
    constructs a `LatLonShapeDocValueField` from a pre-tessellated geometry

  - ### LatLonShapeDocValuesField

    protected LatLonShapeDocValuesField(String name, BytesRef binaryValue)
    Creates a `LatLonShapeDocValueField` from a given serialized value

- ## Method Details

  - ### getCentroid

    public Point getCentroid()
    retrieves the centroid location for the geometry
    Specified by:
      `getCentroid` in class `ShapeDocValuesField`

  - ### getBoundingBox

    public Rectangle getBoundingBox()
    retrieves the bounding box for the geometry
    Specified by:
      `getBoundingBox` in class `ShapeDocValuesField`

  - ### decodeX

    protected double decodeX(int encoded)
    Description copied from class: `ShapeDocValuesField`
    decodes x coordinates from encoded space
    Specified by:
      `decodeX` in class `ShapeDocValuesField`

  - ### decodeY

    protected double decodeY(int encoded)
    Description copied from class: `ShapeDocValuesField`
    decodes y coordinates from encoded space
    Specified by:
      `decodeY` in class `ShapeDocValuesField`