logo
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

Fields

coordinates: GeoLocation

Coordinates

radius: Distance

Circle radius

A circle specified by a center point and radius with units, which default to METERS

GeometryCollection

Fields

geometries: Vec<GeoShape>

A collection of geo shapes

A GeoJSON shape similar to the multi* shapes except that multiple types can coexist (e.g., a Point and a LineString)

Implementations

Creates an instance of GeoShape::Point

Creates an instance of GeoShape::LineString

Creates an instance of GeoShape::Polygon

Creates an instance of GeoShape::MultiPoint

Creates an instance of GeoShape::MultiLineString

Creates an instance of GeoShape::MultiPolygon

Creates an instance of GeoShape::Envelope

Creates an instance of GeoShape::Circle

Creates an instance of GeoShape::GeometryCollection

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.