Package org.apache.lucene.document
Class LatLonShape
- java.lang.Object
-
- org.apache.lucene.document.LatLonShape
-
public class LatLonShape extends java.lang.Object
An geo shape utility class for indexing and searching gis geometries whose vertices are latitude, longitude values (in decimal degrees).This class defines six static factory methods for common indexing and search operations:
createIndexableFields(String, Polygon)
for indexing a geo polygon.createIndexableFields(String, Line)
for indexing a geo linestring.createIndexableFields(String, double, double)
for indexing a lat, lon geo point.newBoxQuery()
for matching geo shapes that have someShapeField.QueryRelation
with a bounding box.newLineQuery()
for matching geo shapes that have someShapeField.QueryRelation
with a linestring.newPolygonQuery()
for matching geo shapes that have someShapeField.QueryRelation
with a polygon.
LatLonPoint
, vertex values are indexed with some loss of precision from the originaldouble
values (4.190951585769653E-8 for the latitude component and 8.381903171539307E-8 for longitude).- See Also:
PointValues
,LatLonDocValuesField
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LatLonShape()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Field[]
createIndexableFields(java.lang.String fieldName, double lat, double lon)
create indexable fields for point geometrystatic Field[]
createIndexableFields(java.lang.String fieldName, Line line)
create indexable fields for line geometrystatic Field[]
createIndexableFields(java.lang.String fieldName, Polygon polygon)
create indexable fields for polygon geometrystatic Query
newBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)
create a query to find all indexed geo shapes that intersect a defined bounding boxstatic Query
newLineQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, Line... lines)
create a query to find all indexed geo shapes that intersect a provided linestring (or array of linestrings) note: does not support dateline crossingstatic Query
newPolygonQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, Polygon... polygons)
create a query to find all indexed geo shapes that intersect a provided polygon (or array of polygons) note: does not support dateline crossing
-
-
-
Method Detail
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, Polygon polygon)
create indexable fields for polygon geometry
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, Line line)
create indexable fields for line geometry
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, double lat, double lon)
create indexable fields for point geometry
-
newBoxQuery
public static Query newBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)
create a query to find all indexed geo shapes that intersect a defined bounding box
-
newLineQuery
public static Query newLineQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, Line... lines)
create a query to find all indexed geo shapes that intersect a provided linestring (or array of linestrings) note: does not support dateline crossing
-
newPolygonQuery
public static Query newPolygonQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, Polygon... polygons)
create a query to find all indexed geo shapes that intersect a provided polygon (or array of polygons) note: does not support dateline crossing
-
-