Package org.apache.lucene.document
Class XYShape
- java.lang.Object
-
- org.apache.lucene.document.XYShape
-
public class XYShape extends java.lang.ObjectA cartesian shape utility class for indexing and searching geometries whose vertices are unitless x, y values.This class defines seven static factory methods for common indexing and search operations:
createIndexableFields(String, XYPolygon)for indexing a cartesian polygon.createIndexableFields(String, XYLine)for indexing a cartesian linestring.createIndexableFields(String, float, float)for indexing a x, y cartesian point.newBoxQuery()for matching cartesian shapes that have someShapeField.QueryRelationwith a bounding box.newLineQuery()for matching cartesian shapes that have someShapeField.QueryRelationwith a linestring.newPolygonQuery()for matching cartesian shapes that have someShapeField.QueryRelationwith a polygon.newGeometryQuery()for matching cartesian shapes that have someShapeField.QueryRelationwith one or moreXYGeometry.
LatLonPoint, vertex values are indexed with some loss of precision from the originaldoublevalues.- See Also:
PointValues,LatLonDocValuesField
-
-
Constructor Summary
Constructors Modifier Constructor Description privateXYShape()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Field[]createIndexableFields(java.lang.String fieldName, float x, float y)create indexable fields for cartesian point geometrystatic Field[]createIndexableFields(java.lang.String fieldName, XYLine line)create indexable fields for cartesian line geometrystatic Field[]createIndexableFields(java.lang.String fieldName, XYPolygon polygon)create indexable fields for cartesian polygon geometrystatic QuerynewBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, float minX, float maxX, float minY, float maxY)create a query to find all cartesian shapes that intersect a defined bounding boxstatic QuerynewDistanceQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYCircle... circle)create a query to find all cartesian shapes that intersect a provided circle (or arrays of circles)static QuerynewGeometryQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYGeometry... xyGeometries)create a query to find all indexed geo shapes that intersect a provided geometry collection note: Components do not support dateline crossingstatic QuerynewLineQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYLine... lines)create a query to find all cartesian shapes that intersect a provided linestring (or array of linestrings)static QuerynewPointQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, float[]... points)create a query to find all indexed shapes that comply theShapeField.QueryRelationwith the provided pointstatic QuerynewPolygonQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYPolygon... polygons)create a query to find all cartesian shapes that intersect a provided polygon (or array of polygons)
-
-
-
Method Detail
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, XYPolygon polygon)
create indexable fields for cartesian polygon geometry
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, XYLine line)
create indexable fields for cartesian line geometry
-
createIndexableFields
public static Field[] createIndexableFields(java.lang.String fieldName, float x, float y)
create indexable fields for cartesian point geometry
-
newBoxQuery
public static Query newBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, float minX, float maxX, float minY, float maxY)
create a query to find all cartesian shapes that intersect a defined bounding box
-
newLineQuery
public static Query newLineQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYLine... lines)
create a query to find all cartesian shapes that intersect a provided linestring (or array of linestrings)
-
newPolygonQuery
public static Query newPolygonQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYPolygon... polygons)
create a query to find all cartesian shapes that intersect a provided polygon (or array of polygons)
-
newPointQuery
public static Query newPointQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, float[]... points)
create a query to find all indexed shapes that comply theShapeField.QueryRelationwith the provided point
-
newDistanceQuery
public static Query newDistanceQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYCircle... circle)
create a query to find all cartesian shapes that intersect a provided circle (or arrays of circles)
-
newGeometryQuery
public static Query newGeometryQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, XYGeometry... xyGeometries)
create a query to find all indexed geo shapes that intersect a provided geometry collection note: Components do not support dateline crossing
-
-