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 |
---|---|
protected PlanetModel |
planetModel
Planet Model for this Geo3DPoint
|
static FieldType |
TYPE
Indexing
FieldType . |
fieldsData, name, tokenStream, type
Constructor and Description |
---|
Geo3DPoint(String name,
double lat,
double lon)
Creates a new Geo3DPoint field with the specified latitude, longitude (in degrees), with default WGS84 PlanetModel.
|
Geo3DPoint(String name,
double x,
double y,
double z)
Creates a new Geo3DPoint field with the specified x,y,z, using default WGS84 planet model.
|
Geo3DPoint(String name,
PlanetModel planetModel,
double latitude,
double longitude)
Creates a new Geo3DPoint field with the specified latitude, longitude (in degrees), given a planet model.
|
Geo3DPoint(String name,
PlanetModel planetModel,
double x,
double y,
double z)
Creates a new Geo3DPoint field with the specified x,y,z, and given planet model.
|
Modifier and Type | Method and Description |
---|---|
static double |
decodeDimension(byte[] value,
int offset,
PlanetModel planetModel)
Decode single dimension
|
static void |
encodeDimension(double value,
byte[] bytes,
int offset,
PlanetModel planetModel)
Encode single dimension
|
static Query |
newBoxQuery(String field,
PlanetModel planetModel,
double minLatitude,
double maxLatitude,
double minLongitude,
double maxLongitude)
Create a query for matching a box.
|
static Query |
newDistanceQuery(String field,
PlanetModel planetModel,
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,
PlanetModel planetModel,
Polygon... polygons)
Create a query for matching a large polygon.
|
static Query |
newPathQuery(String field,
double[] pathLatitudes,
double[] pathLongitudes,
double pathWidthMeters,
PlanetModel planetModel)
Create a query for matching a path.
|
static Query |
newPolygonQuery(String field,
PlanetModel planetModel,
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, getCharSequenceValue, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue
protected final PlanetModel planetModel
public Geo3DPoint(String name, double lat, double lon)
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 Geo3DPoint(String name, PlanetModel planetModel, double x, double y, double z)
IllegalArgumentException
- if the field name is null or latitude or longitude are out of boundspublic Geo3DPoint(String name, PlanetModel planetModel, double latitude, double longitude)
IllegalArgumentException
- if the field name is null or latitude or longitude are out of boundspublic static Query newDistanceQuery(String field, PlanetModel planetModel, double latitude, double longitude, double radiusMeters)
field
- field name. must not be null. Note that if
PlanetModel.WGS84
is used, the 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, PlanetModel planetModel, 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, PlanetModel planetModel, 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, PlanetModel planetModel, 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, PlanetModel planetModel)
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, PlanetModel planetModel)
public static double decodeDimension(byte[] value, int offset, PlanetModel planetModel)
public static Query newShapeQuery(String field, GeoShape shape)
field
- field name. must not be null
.shape
- Which GeoShape
to matchCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.