Package 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 theTessellatorutility class EachTessellator.Triangleis 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.
 LatLonPoint, vertex values are indexed with some loss of precision from the originaldoublevalues (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 SummaryNested Classes Modifier and Type Class Description static classLatLonShape.QueryRelationQuery Relation Types
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static Field[]createIndexableFields(String fieldName, double lat, double lon)create indexable fields for point geometrystatic Field[]createIndexableFields(String fieldName, Line line)create indexable fields for line geometrystatic Field[]createIndexableFields(String fieldName, Polygon polygon)create indexable fields for polygon geometrystatic voiddecodeTriangle(byte[] t, int[] triangle)Decode a triangle encoded byencodeTriangle(byte[], int, int, int, int, int, int).static voidencodeTriangle(byte[] bytes, int aLat, int aLon, int bLat, int bLon, int cLat, int cLon)A triangle is encoded using 6 points and an extra point with encoded information in three bits of how to reconstruct it.static QuerynewBoxQuery(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 boxstatic QuerynewLineQuery(String field, LatLonShape.QueryRelation queryRelation, Line... lines)create a query to find all polygons that intersect a provided linestring (or array of linestrings) note: does not support dateline crossingstatic QuerynewPolygonQuery(String field, LatLonShape.QueryRelation queryRelation, Polygon... polygons)create a query to find all polygons that intersect a provided polygon (or array of polygons) note: does not support dateline crossing
 
- 
- 
- 
Field Detail- 
TYPEprotected static final FieldType TYPE 
 
- 
 - 
Method Detail- 
createIndexableFieldspublic static Field[] createIndexableFields(String fieldName, Polygon polygon) create indexable fields for polygon geometry
 - 
createIndexableFieldspublic static Field[] createIndexableFields(String fieldName, Line line) create indexable fields for line geometry
 - 
createIndexableFieldspublic static Field[] createIndexableFields(String fieldName, double lat, double lon) create indexable fields for point geometry
 - 
newBoxQuerypublic 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
 - 
newLineQuerypublic static Query newLineQuery(String field, LatLonShape.QueryRelation queryRelation, Line... lines) create a query to find all polygons that intersect a provided linestring (or array of linestrings) note: does not support dateline crossing
 - 
newPolygonQuerypublic static Query newPolygonQuery(String field, LatLonShape.QueryRelation queryRelation, Polygon... polygons) create a query to find all polygons that intersect a provided polygon (or array of polygons) note: does not support dateline crossing
 - 
encodeTrianglepublic static void encodeTriangle(byte[] bytes, int aLat, int aLon, int bLat, int bLon, int cLat, int cLon)A triangle is encoded using 6 points and an extra point with encoded information in three bits of how to reconstruct it. Triangles are encoded with CCW orientation and might be rotated to limit the number of possible reconstructions to 2^3. Reconstruction always happens from west to east.
 - 
decodeTrianglepublic static void decodeTriangle(byte[] t, int[] triangle)Decode a triangle encoded byencodeTriangle(byte[], int, int, int, int, int, int).
 
- 
 
-