Enum elasticsearch_dsl::search::params::Shape
source · pub enum Shape {
Point {
coordinates: Coordinate,
},
LineString {
coordinates: Vec<Coordinate>,
},
Polygon {
coordinates: Vec<Vec<Coordinate>>,
},
MultiPoint {
coordinates: Vec<Coordinate>,
},
MultiLineString {
coordinates: Vec<Vec<Coordinate>>,
},
MultiPolygon {
coordinates: Vec<Vec<Vec<Coordinate>>>,
},
Envelope {
coordinates: (Coordinate, Coordinate),
},
GeometryCollection {
geometries: Vec<Shape>,
},
}Expand description
The shape data type facilitates the indexing of and searching with
arbitrary x, y cartesian shapes such as rectangles and polygons. It can
be used to index and query geometries whose coordinates fall in a
2-dimensional planar coordinate system.
Variants§
Point
A single x, y coordinate
Fields
coordinates: CoordinateCoordinates
LineString
An arbitrary line given two or more points
Fields
coordinates: Vec<Coordinate>Coordinates
Polygon
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
Fields
coordinates: Vec<Vec<Coordinate>>Coordinates
MultiPoint
An array of unconnected, but likely related points
Fields
coordinates: Vec<Coordinate>Coordinates
MultiLineString
An array of separate linestrings
Fields
coordinates: Vec<Vec<Coordinate>>Coordinates
MultiPolygon
An array of separate polygons
Fields
coordinates: Vec<Vec<Vec<Coordinate>>>Coordinates
Envelope
A bounding rectangle, or envelope, specified by specifying only the top left and bottom right points.
Fields
coordinates: (Coordinate, Coordinate)Coordinates
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 Shape
impl Shape
sourcepub fn point<T>(coordinates: T) -> Selfwhere
T: Into<Coordinate>,
pub fn point<T>(coordinates: T) -> Selfwhere
T: Into<Coordinate>,
Creates an instance of Shape::Point
sourcepub fn line_string<T>(coordinates: T) -> Self
pub fn line_string<T>(coordinates: T) -> Self
Creates an instance of Shape::LineString
sourcepub fn polygon<T>(coordinates: T) -> Self
pub fn polygon<T>(coordinates: T) -> Self
Creates an instance of Shape::Polygon
sourcepub fn multi_point<T>(coordinates: T) -> Self
pub fn multi_point<T>(coordinates: T) -> Self
Creates an instance of Shape::MultiPoint
sourcepub fn multi_line_string<T>(coordinates: T) -> Self
pub fn multi_line_string<T>(coordinates: T) -> Self
Creates an instance of Shape::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<Coordinate>,
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<Coordinate>,
Creates an instance of Shape::MultiPolygon
sourcepub fn envelope<T>(top_left: T, bottom_right: T) -> Selfwhere
T: Into<Coordinate>,
pub fn envelope<T>(top_left: T, bottom_right: T) -> Selfwhere
T: Into<Coordinate>,
Creates an instance of Shape::Envelope
sourcepub fn geometry_collection<T>(geometries: T) -> Self
pub fn geometry_collection<T>(geometries: T) -> Self
Creates an instance of Shape::GeometryCollection
Trait Implementations§
impl StructuralPartialEq for Shape
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnwindSafe for Shape
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)