org.apache.lucene.document

## Class LatLonShape

- java.lang.Object
- - org.apache.lucene.document.LatLonShape

-     public class LatLonShape
      extends Object

  An indexed shape utility class.

  `Polygon`'s are decomposed into a triangular mesh using the `Tessellator` utility class Each `Tessellator.Triangle` is encoded and indexed as a multi-value field.

  Finding all shapes that intersect a range (e.g., bounding box) at search time is efficient.

  This class defines static factory methods for common operations:

  - `createIndexableFields(String, Polygon)` for matching polygons that intersect a bounding box.
  - `newBoxQuery()` for matching polygons that intersect a bounding box.
  WARNING: Like `LatLonPoint`, vertex values are indexed with some loss of precision from the original `double` values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for longitude).
  See Also:
    `PointValues`, `LatLonDocValuesField`
  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` | `LatLonShape.QueryRelation` Query Relation Types

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BYTES`
    `protected static FieldType` | `TYPE`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Field[]` | `createIndexableFields(String fieldName, double lat, double lon)` create indexable fields for point geometry
    `static Field[]` | `createIndexableFields(String fieldName, Line line)` create indexable fields for line geometry
    `static Field[]` | `createIndexableFields(String fieldName, Polygon polygon)` create indexable fields for polygon geometry
    `static Query` | `newBoxQuery(String field, LatLonShape.QueryRelation queryRelation, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)` create a query to find all polygons that intersect a defined bounding box note: does not currently support dateline crossing boxes todo split dateline crossing boxes into two queries like `LatLonPoint.newBoxQuery(java.lang.String, double, double, double, double)`
    `static Query` | `newPolygonQuery(String field, LatLonShape.QueryRelation queryRelation, Polygon... polygons)`

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

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

- - ### Field Detail

    - #### BYTES

          public static final int BYTES

      See Also:
        Constant Field Values

    - #### TYPE

          protected static final FieldType TYPE

  - ### Method Detail

    - #### createIndexableFields

          public static Field[] createIndexableFields(String fieldName,
                                                      Polygon polygon)

      create indexable fields for polygon geometry

    - #### createIndexableFields

          public static Field[] createIndexableFields(String fieldName,
                                                      Line line)

      create indexable fields for line geometry

    - #### createIndexableFields

          public static Field[] createIndexableFields(String fieldName,
                                                      double lat,
                                                      double lon)

      create indexable fields for point geometry

    - #### newBoxQuery

          public static Query newBoxQuery(String field,
                                          LatLonShape.QueryRelation queryRelation,
                                          double minLatitude,
                                          double maxLatitude,
                                          double minLongitude,
                                          double maxLongitude)

      create a query to find all polygons that intersect a defined bounding box note: does not currently support dateline crossing boxes todo split dateline crossing boxes into two queries like `LatLonPoint.newBoxQuery(java.lang.String, double, double, double, double)`

    - #### newPolygonQuery

          public static Query newPolygonQuery(String field,
                                              LatLonShape.QueryRelation queryRelation,
                                              Polygon... polygons)

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