- All Implemented Interfaces:
GenericNamedWriteable,NamedWriteable,VersionedNamedWriteable,Writeable,ToXContent,ToXContentFragment
A class representing a Geo-Bounding-Box for use by Geo queries and aggregations
that deal with extents/rectangles representing rectangular areas of interest.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.common.geo.BoundingBox
BoundingBox.BoundsParser<T extends BoundingBox<? extends SpatialPoint>>Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.common.geo.BoundingBox
BOTTOM_RIGHT_FIELD, bottomRight, BOUNDS_FIELD, TOP_LEFT_FIELD, topLeftFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionGeoBoundingBox(GeoPoint topLeft, GeoPoint bottomRight) GeoBoundingBox(StreamInput input) -
Method Summary
Modifier and TypeMethodDescriptionfinal TransportVersionThe minimal version of the recipient this object can be sent to.final StringReturns the name of the writeable objectstatic GeoBoundingBoxparseBoundingBox(XContentParser parser) Parses the bounding box and returns bottom, top, left, right coordinatesbooleanpointInBounds(double lon, double lat) If the bounding box crosses the date-line (left greater-than right) then the longitude of the point need only to be higher than the left or lower than the right.topLeft()toXContentFragment(XContentBuilder builder) There exists a special case where we use an array format for building the XContent for the bounds.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.common.geo.BoundingBox
bottom, equals, hashCode, isUnbounded, left, right, top, toString, toXContentMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Field Details
-
LAT_FIELD
-
LON_FIELD
-
-
Constructor Details
-
GeoBoundingBox
-
GeoBoundingBox
- Throws:
IOException
-
-
Method Details
-
topLeft
- Overrides:
topLeftin classBoundingBox<GeoPoint>
-
bottomRight
- Overrides:
bottomRightin classBoundingBox<GeoPoint>
-
toXContentFragment
- Specified by:
toXContentFragmentin classBoundingBox<GeoPoint>- Throws:
IOException
-
toXContentFragmentWithArray
There exists a special case where we use an array format for building the XContent for the bounds. Specifically the GeoBoundingBoxQueryBuilder makes use of this. All other cases build a keyed map.- Throws:
IOException
-
pointInBounds
public boolean pointInBounds(double lon, double lat) If the bounding box crosses the date-line (left greater-than right) then the longitude of the point need only to be higher than the left or lower than the right. Otherwise, it must be both.- Parameters:
lon- the longitude of the pointlat- the latitude of the point- Returns:
- whether the point (lon, lat) is in the specified bounding box
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object -
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to. SeeVersionedNamedWriteable.supportsVersion(TransportVersion)for the default serialization check. -
parseBoundingBox
public static GeoBoundingBox parseBoundingBox(XContentParser parser) throws IOException, ElasticsearchParseException Parses the bounding box and returns bottom, top, left, right coordinates
-