public final class Geo3DPoint extends Field
This field defines static factory methods for creating a shape query:
newShapeQuery()
for matching all points inside a specified shape
PointValues
Field.Store
Modifier and Type | Field and Description |
---|---|
static FieldType |
TYPE
Indexing
FieldType . |
fieldsData, name, tokenStream, type
Constructor and Description |
---|
Geo3DPoint(String name,
double latitude,
double longitude)
Creates a new Geo3DPoint field with the specified latitude, longitude (in degrees).
|
Geo3DPoint(String name,
double x,
double y,
double z)
Creates a new Geo3DPoint field with the specified x,y,z.
|
Modifier and Type | Method and Description |
---|---|
static double |
decodeDimension(byte[] value,
int offset)
Decode single dimension
|
static void |
encodeDimension(double value,
byte[] bytes,
int offset)
Encode single dimension
|
static Query |
newBoxQuery(String field,
double minLatitude,
double maxLatitude,
double minLongitude,
double maxLongitude)
Create a query for matching a box.
|
static Query |
newDistanceQuery(String field,
double latitude,
double longitude,
double radiusMeters)
Create a query for matching points within the specified distance of the supplied location.
|
static Query |
newLargePolygonQuery(String field,
Polygon... polygons)
Create a query for matching a large polygon.
|
static Query |
newPathQuery(String field,
double[] pathLatitudes,
double[] pathLongitudes,
double pathWidthMeters)
Create a query for matching a path.
|
static Query |
newPolygonQuery(String field,
Polygon... polygons)
Create a query for matching a polygon.
|
static Query |
newShapeQuery(String field,
GeoShape shape)
Returns a query matching all points inside the provided shape.
|
String |
toString() |
binaryValue, fieldType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue
public Geo3DPoint(String name, double latitude, double longitude)
IllegalArgumentException
- if the field name is null or latitude or longitude are out of boundspublic Geo3DPoint(String name, double x, double y, double z)
IllegalArgumentException
- if the field name is null or latitude or longitude are out of boundspublic static Query newDistanceQuery(String field, double latitude, double longitude, double radiusMeters)
field
- field name. must not be null. Note that because
PlanetModel.WGS84
is used, this query is approximate and may have up
to 0.5% error.latitude
- latitude at the center: must be within standard +/-90 coordinate bounds.longitude
- longitude at the center: must be within standard +/-180 coordinate bounds.radiusMeters
- maximum distance from the center in meters: must be non-negative and finite.IllegalArgumentException
- if field
is null, location has invalid coordinates, or radius is invalid.public static Query newBoxQuery(String field, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude)
The box may cross over the dateline.
field
- field name. must not be null.minLatitude
- latitude lower bound: must be within standard +/-90 coordinate bounds.maxLatitude
- latitude upper bound: must be within standard +/-90 coordinate bounds.minLongitude
- longitude lower bound: must be within standard +/-180 coordinate bounds.maxLongitude
- longitude upper bound: must be within standard +/-180 coordinate bounds.IllegalArgumentException
- if field
is null, or the box has invalid coordinates.public static Query newPolygonQuery(String field, Polygon... polygons)
The supplied polygons
must be clockwise on the outside level, counterclockwise on the next level in, etc.
field
- field name. must not be null.polygons
- is the list of polygons to use to construct the query; must be at least one.public static Query newLargePolygonQuery(String field, Polygon... polygons)
The supplied polygons
must be clockwise on the outside level, counterclockwise on the next level in, etc.
field
- field name. must not be null.polygons
- is the list of polygons to use to construct the query; must be at least one.public static Query newPathQuery(String field, double[] pathLatitudes, double[] pathLongitudes, double pathWidthMeters)
field
- field name. must not be null.pathLatitudes
- latitude values for points of the path: must be within standard +/-90 coordinate bounds.pathLongitudes
- longitude values for points of the path: must be within standard +/-180 coordinate bounds.pathWidthMeters
- width of the path in meters.public static void encodeDimension(double value, byte[] bytes, int offset)
public static double decodeDimension(byte[] value, int offset)
public static Query newShapeQuery(String field, GeoShape shape)
field
- field name. must not be null
.shape
- Which GeoShape
to matchCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.