public class LatLonBoundingBox extends Field
This field indexes 2-dimension Latitude, Longitude based Geospatial Bounding Boxes. The bounding boxes are defined as
minLat, minLon, maxLat, maxLon
where min/max lat,lon pairs using double floating point precision.
Multiple values for the same field in one document is supported.
This field defines the following static factory methods for common search operations over double ranges:
newIntersectsQuery()
matches bounding boxes that intersect the defined search bounding box.
newWithinQuery()
matches bounding boxes that are within the defined search bounding box.
newContainsQuery()
matches bounding boxes that contain the defined search bounding box.
newCrosses()
matches bounding boxes that cross the defined search bounding box.
The following Field limitations and restrictions apply:
Field.Store
Modifier and Type | Field and Description |
---|---|
static int |
BYTES
uses same encoding as
LatLonPoint so numBytes is the same |
fieldsData, name, tokenStream, type
Constructor and Description |
---|
LatLonBoundingBox(String name,
double minLat,
double minLon,
double maxLat,
double maxLon)
Create a new 2D GeoBoundingBoxField representing a 2 dimensional geospatial bounding box
|
Modifier and Type | Method and Description |
---|---|
static Query |
newContainsQuery(String field,
double minLat,
double minLon,
double maxLat,
double maxLon)
Create a new 2d query that finds all indexed 2d GeoBoundingBoxField values that contain the defined
2d bounding box
|
static Query |
newCrossesQuery(String field,
double minLat,
double minLon,
double maxLat,
double maxLon)
Create a new 2d query that finds all indexed 2d GeoBoundingBoxField values that cross the defined
3d bounding box
|
static Query |
newIntersectsQuery(String field,
double minLat,
double minLon,
double maxLat,
double maxLon)
Create a new 2d query that finds all indexed 2d GeoBoundingBoxField values that intersect the defined
3d bounding ranges
|
static Query |
newWithinQuery(String field,
double minLat,
double minLon,
double maxLat,
double maxLon)
Create a new 2d query that finds all indexed 2d GeoBoundingBoxField values that are within the defined
2d bounding box
|
void |
setRangeValues(double minLat,
double minLon,
double maxLat,
double maxLon)
Changes the values of the field
|
String |
toString() |
binaryValue, fieldType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue
public static final int BYTES
LatLonPoint
so numBytes is the samepublic LatLonBoundingBox(String name, double minLat, double minLon, double maxLat, double maxLon)
name
- field name. must not be nullminLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]public void setRangeValues(double minLat, double minLon, double maxLat, double maxLon)
minLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]IllegalArgumentException
- if min
or max
is invalidpublic static Query newIntersectsQuery(String field, double minLat, double minLon, double maxLat, double maxLon)
field
- field name. must not be nullminLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]public static Query newWithinQuery(String field, double minLat, double minLon, double maxLat, double maxLon)
field
- field name. must not be nullminLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]public static Query newContainsQuery(String field, double minLat, double minLon, double maxLat, double maxLon)
field
- field name. must not be nullminLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]public static Query newCrossesQuery(String field, double minLat, double minLon, double maxLat, double maxLon)
field
- field name. must not be nullminLat
- minimum latitude value (in degrees); valid in [-90.0 : 90.0]minLon
- minimum longitude value (in degrees); valid in [-180.0 : 180.0]maxLat
- maximum latitude value (in degrees); valid in [minLat : 90.0]maxLon
- maximum longitude value (in degrees); valid in [minLon : 180.0]Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.