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
sourceimpl GeoShape
impl GeoShape
sourcepub fn point<T>(coordinates: T) -> Self where
T: Into<GeoLocation>,
pub fn point<T>(coordinates: T) -> Self where
T: Into<GeoLocation>,
Creates an instance of GeoShape::Point
sourcepub fn line_string<T>(coordinates: T) -> Self where
T: IntoIterator,
T::Item: Into<GeoLocation>,
pub fn line_string<T>(coordinates: T) -> Self where
T: IntoIterator,
T::Item: Into<GeoLocation>,
Creates an instance of GeoShape::LineString
sourcepub fn polygon<T>(coordinates: T) -> Self where
T: IntoIterator,
T::Item: IntoIterator,
<T::Item as IntoIterator>::Item: Into<GeoLocation>,
pub fn polygon<T>(coordinates: T) -> Self where
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) -> Self where
T: IntoIterator,
T::Item: Into<GeoLocation>,
pub fn multi_point<T>(coordinates: T) -> Self where
T: IntoIterator,
T::Item: Into<GeoLocation>,
Creates an instance of GeoShape::MultiPoint
sourcepub fn multi_line_string<T>(coordinates: T) -> Self where
T: IntoIterator,
T::Item: IntoIterator,
<T::Item as IntoIterator>::Item: Into<GeoLocation>,
pub fn multi_line_string<T>(coordinates: T) -> Self where
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) -> Self where
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) -> Self where
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) -> Self where
T: Into<GeoLocation>,
pub fn envelope<T>(top_left: T, bottom_right: T) -> Self where
T: Into<GeoLocation>,
Creates an instance of GeoShape::Envelope
sourcepub fn circle<T, R>(coordinates: T, radius: R) -> Self where
T: Into<GeoLocation>,
R: Into<Distance>,
pub fn circle<T, R>(coordinates: T, radius: R) -> Self where
T: Into<GeoLocation>,
R: Into<Distance>,
Creates an instance of GeoShape::Circle
sourcepub fn geometry_collection<T>(geometries: T) -> Self where
T: IntoIterator,
T::Item: Into<Self>,
pub fn geometry_collection<T>(geometries: T) -> Self where
T: IntoIterator,
T::Item: Into<Self>,
Creates an instance of GeoShape::GeometryCollection
Trait Implementations
impl StructuralPartialEq for GeoShape
Auto Trait Implementations
impl RefUnwindSafe for GeoShape
impl Send for GeoShape
impl Sync for GeoShape
impl Unpin for GeoShape
impl UnwindSafe for GeoShape
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more