Enum elasticsearch_dsl::search::params::GeoShape
source · pub enum GeoShape {
Point {
coordinates: GeoLocation,
},
LineString {
coordinates: Vec<GeoLocation>,
},
Polygon {
coordinates: Vec<Vec<GeoLocation>>,
},
MultiPoint {
coordinates: Vec<GeoLocation>,
},
MultiLineString {
coordinates: Vec<Vec<GeoLocation>>,
},
MultiPolygon {
coordinates: Vec<Vec<Vec<GeoLocation>>>,
},
Envelope {
coordinates: (GeoLocation, GeoLocation),
},
Circle {
coordinates: GeoLocation,
radius: Distance,
},
GeometryCollection {
geometries: Vec<GeoShape>,
},
}
Expand description
The geo_shape
data type facilitates the indexing of and searching with
arbitrary geo shapes such as rectangles and polygons. It should be used
when either the data being indexed or the queries being executed contain
shapes other than just points.
Variants§
Point
Fields
coordinates: GeoLocation
Coordinates
A single geographic coordinate
Note: Elasticsearch uses WGS-84 coordinates only
LineString
Fields
coordinates: Vec<GeoLocation>
Coordinates
An arbitrary line given two or more points
Polygon
Fields
coordinates: Vec<Vec<GeoLocation>>
Coordinates
A closed polygon whose first and last point must match, thus requiring
n + 1
vertices to create an n-sided
polygon and a minimum of 4
vertices
MultiPoint
Fields
coordinates: Vec<GeoLocation>
Coordinates
An array of unconnected, but likely related points
MultiLineString
Fields
coordinates: Vec<Vec<GeoLocation>>
Coordinates
An array of separate linestrings
MultiPolygon
Fields
coordinates: Vec<Vec<Vec<GeoLocation>>>
Coordinates
An array of separate polygons
Envelope
Fields
coordinates: (GeoLocation, GeoLocation)
Coordinates
A bounding rectangle, or envelope, specified by specifying only the top left and bottom right points.
Circle
A circle specified by a center point and radius with units,
which default to METERS
GeometryCollection
A GeoJSON shape similar to the multi*
shapes except that multiple
types can coexist (e.g., a Point and a LineString)
Implementations§
source§impl GeoShape
impl GeoShape
sourcepub fn point<T>(coordinates: T) -> Selfwhere
T: Into<GeoLocation>,
pub fn point<T>(coordinates: T) -> Selfwhere T: Into<GeoLocation>,
Creates an instance of GeoShape::Point
sourcepub fn line_string<T>(coordinates: T) -> Selfwhere
T: IntoIterator,
T::Item: Into<GeoLocation>,
pub fn line_string<T>(coordinates: T) -> Selfwhere T: IntoIterator, T::Item: Into<GeoLocation>,
Creates an instance of GeoShape::LineString
sourcepub fn polygon<T>(coordinates: T) -> Selfwhere
T: IntoIterator,
T::Item: IntoIterator,
<T::Item as IntoIterator>::Item: Into<GeoLocation>,
pub fn polygon<T>(coordinates: T) -> Selfwhere T: IntoIterator, T::Item: IntoIterator, <T::Item as IntoIterator>::Item: Into<GeoLocation>,
Creates an instance of GeoShape::Polygon
sourcepub fn multi_point<T>(coordinates: T) -> Selfwhere
T: IntoIterator,
T::Item: Into<GeoLocation>,
pub fn multi_point<T>(coordinates: T) -> Selfwhere T: IntoIterator, T::Item: Into<GeoLocation>,
Creates an instance of GeoShape::MultiPoint
sourcepub fn multi_line_string<T>(coordinates: T) -> Selfwhere
T: IntoIterator,
T::Item: IntoIterator,
<T::Item as IntoIterator>::Item: Into<GeoLocation>,
pub fn multi_line_string<T>(coordinates: T) -> Selfwhere T: IntoIterator, T::Item: IntoIterator, <T::Item as IntoIterator>::Item: Into<GeoLocation>,
Creates an instance of GeoShape::MultiLineString
sourcepub fn multi_polygon<T>(coordinates: T) -> Selfwhere
T: IntoIterator,
T::Item: IntoIterator,
<T::Item as IntoIterator>::Item: IntoIterator,
<<T::Item as IntoIterator>::Item as IntoIterator>::Item: Into<GeoLocation>,
pub fn multi_polygon<T>(coordinates: T) -> Selfwhere T: IntoIterator, T::Item: IntoIterator, <T::Item as IntoIterator>::Item: IntoIterator, <<T::Item as IntoIterator>::Item as IntoIterator>::Item: Into<GeoLocation>,
Creates an instance of GeoShape::MultiPolygon
sourcepub fn envelope<T>(top_left: T, bottom_right: T) -> Selfwhere
T: Into<GeoLocation>,
pub fn envelope<T>(top_left: T, bottom_right: T) -> Selfwhere T: Into<GeoLocation>,
Creates an instance of GeoShape::Envelope
sourcepub fn circle<T, R>(coordinates: T, radius: R) -> Selfwhere
T: Into<GeoLocation>,
R: Into<Distance>,
pub fn circle<T, R>(coordinates: T, radius: R) -> Selfwhere T: Into<GeoLocation>, R: Into<Distance>,
Creates an instance of GeoShape::Circle
sourcepub fn geometry_collection<T>(geometries: T) -> Selfwhere
T: IntoIterator,
T::Item: Into<Self>,
pub fn geometry_collection<T>(geometries: T) -> Selfwhere T: IntoIterator, T::Item: Into<Self>,
Creates an instance of GeoShape::GeometryCollection