public final class GeoPointInPolygonQuery extends GeoPointInBBoxQuery
GeoPointInBBoxQueryImpl and is implemented using a
three phase approach. First, like GeoPointInBBoxQueryImpl
candidate terms are queried using a numeric range based on the morton codes
of the min and max lat/lon pairs. Terms passing this initial filter are passed
to a secondary filter that verifies whether the decoded lat/lon point falls within
(or on the boundary) of the bounding box query. Finally, the remaining candidate
term is passed to the final point in polygon check. All value comparisons are subject
to the same precision tolerance defined in 1.0E-6
NOTES: 1. The polygon coordinates need to be in either clockwise or counter-clockwise order. 2. The polygon must not be self-crossing, otherwise the query may result in unexpected behavior 3. All latitude/longitude values must be in decimal degrees. 4. Complex computational geometry (e.g., dateline wrapping, polygon with holes) is not supported 5. For more advanced GeoSpatial indexing and query operations see spatial module
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
x |
protected double[] |
y |
field, maxLat, maxLon, minLat, minLon, termEncoding| Constructor and Description |
|---|
GeoPointInPolygonQuery(String field,
double[] polyLons,
double[] polyLats) |
GeoPointInPolygonQuery(String field,
GeoPointField.TermEncoding termEncoding,
double[] polyLons,
double[] polyLats)
Constructs a new GeoPolygonQuery that will match encoded
GeoPointField terms
that fall within or on the boundary of the polygon defined by the input parameters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
double[] |
getLats()
API utility method for returning the array of latitudinal values for this GeoPolygon
The returned array is not a copy so do not change it!
|
double[] |
getLons()
API utility method for returning the array of longitudinal values for this GeoPolygon
The returned array is not a copy so do not change it!
|
int |
hashCode() |
Query |
rewrite(IndexReader reader)
throw exception if trying to change rewrite method
|
String |
toString(String field)
print out this polygon query
|
getField, getMaxLat, getMaxLon, getMinLat, getMinLonpublic GeoPointInPolygonQuery(String field, double[] polyLons, double[] polyLats)
public GeoPointInPolygonQuery(String field, GeoPointField.TermEncoding termEncoding, double[] polyLons, double[] polyLats)
GeoPointField terms
that fall within or on the boundary of the polygon defined by the input parameters.public Query rewrite(IndexReader reader) throws IOException
rewrite in class GeoPointInBBoxQueryIOExceptionpublic boolean equals(Object o)
equals in class GeoPointInBBoxQuerypublic int hashCode()
hashCode in class GeoPointInBBoxQuerypublic String toString(String field)
toString in class GeoPointInBBoxQuerypublic double[] getLons()
public double[] getLats()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.