pub enum Geometry {
Point(Point<f64>),
Line(LineString<f64>),
Polygon(Polygon<f64>),
MultiPoint(MultiPoint<f64>),
MultiLine(MultiLineString<f64>),
MultiPolygon(MultiPolygon<f64>),
Collection(Vec<Geometry>),
}Variants§
Point(Point<f64>)
Line(LineString<f64>)
Polygon(Polygon<f64>)
MultiPoint(MultiPoint<f64>)
MultiLine(MultiLineString<f64>)
MultiPolygon(MultiPolygon<f64>)
Collection(Vec<Geometry>)
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn walk_revisioned_variant_name(
wire_revision: u16,
discriminant: u32,
) -> Option<&'static str>
pub fn walk_revisioned_variant_name( wire_revision: u16, discriminant: u32, ) -> Option<&'static str>
Resolve a wire discriminant at wire_revision to the variant
identifier at that revision. Returns None if no such variant
exists at that revision.
Generated by the revisioned derive.
Sourcepub fn walk_revisioned_variant_table(
wire_revision: u16,
) -> &'static [(&'static str, u32)]
pub fn walk_revisioned_variant_table( wire_revision: u16, ) -> &'static [(&'static str, u32)]
Variant name + discriminant pairs at wire_revision. Returns
an empty slice if the revision is unknown. Generated by the
revisioned derive.
Source§impl Geometry
impl Geometry
Sourcepub fn is_geometry(&self) -> bool
pub fn is_geometry(&self) -> bool
Check if this is not a Collection
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Check if this is a Collection
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Check if this has valid latitude and longitude points:
- -90 <= lat <= 90
- -180 <= lng <= 180
Sourcepub fn as_coordinates(&self) -> Value
pub fn as_coordinates(&self) -> Value
Get the raw coordinates of this Geometry as an Array
pub fn try_from_object(object: &Object) -> Option<Geometry>
Sourcepub fn array_to_multipolygon(v: &Value) -> Option<MultiPolygon<f64>>
pub fn array_to_multipolygon(v: &Value) -> Option<MultiPolygon<f64>>
Converts a surreal value to a MultiPolygon if the array matches to a MultiPolygon.
Sourcepub fn array_to_multiline(v: &Value) -> Option<MultiLineString<f64>>
pub fn array_to_multiline(v: &Value) -> Option<MultiLineString<f64>>
Converts a surreal value to a MultiLine if the array matches to a MultiLine.
Sourcepub fn array_to_multipoint(v: &Value) -> Option<MultiPoint<f64>>
pub fn array_to_multipoint(v: &Value) -> Option<MultiPoint<f64>>
Converts a surreal value to a MultiPoint if the array matches to a MultiPoint.
Sourcepub fn array_to_polygon(v: &Value) -> Option<Polygon<f64>>
pub fn array_to_polygon(v: &Value) -> Option<Polygon<f64>>
Converts a surreal value to a Polygon if the array matches to a Polygon.
Sourcepub fn array_to_line(v: &Value) -> Option<LineString<f64>>
pub fn array_to_line(v: &Value) -> Option<LineString<f64>>
Converts a surreal value to a LineString if the array matches to a LineString.
Sourcepub fn array_to_point(v: &Value) -> Option<Point<f64>>
pub fn array_to_point(v: &Value) -> Option<Point<f64>>
Converts a surreal value to a Point if the array matches to a point.
pub fn contains(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Trait Implementations§
Source§impl<'de, F> BorrowDecode<'de, F> for Geometry
impl<'de, F> BorrowDecode<'de, F> for Geometry
fn borrow_decode(r: &mut BorrowReader<'de>) -> Result<Self, DecodeError>
Source§impl DeserializeRevisioned for Geometry
impl DeserializeRevisioned for Geometry
Source§impl From<LineString> for Geometry
impl From<LineString> for Geometry
Source§fn from(v: LineString<f64>) -> Self
fn from(v: LineString<f64>) -> Self
Source§impl From<MultiLineString> for Geometry
impl From<MultiLineString> for Geometry
Source§fn from(v: MultiLineString<f64>) -> Self
fn from(v: MultiLineString<f64>) -> Self
Source§impl From<MultiPoint> for Geometry
impl From<MultiPoint> for Geometry
Source§fn from(v: MultiPoint<f64>) -> Self
fn from(v: MultiPoint<f64>) -> Self
Source§impl From<MultiPolygon> for Geometry
impl From<MultiPolygon> for Geometry
Source§fn from(v: MultiPolygon<f64>) -> Self
fn from(v: MultiPolygon<f64>) -> Self
Source§impl PartialOrd for Geometry
impl PartialOrd for Geometry
Source§impl Revisioned for Geometry
impl Revisioned for Geometry
Source§impl SerializeRevisioned for Geometry
impl SerializeRevisioned for Geometry
Source§impl SkipCheckRevisioned for Geometry
impl SkipCheckRevisioned for Geometry
Source§impl SkipRevisioned for Geometry
impl SkipRevisioned for Geometry
fn skip_revisioned<R: Read>(reader: &mut R) -> Result<(), Error>
Source§fn skip_revisioned_slice(reader: &mut SliceReader<'_>) -> Result<(), Error>
fn skip_revisioned_slice(reader: &mut SliceReader<'_>) -> Result<(), Error>
SliceReader without allocating a buffer for bulk segments. Read moreimpl StructuralPartialEq for Geometry
Source§impl WalkRevisioned for Geometry
impl WalkRevisioned for Geometry
Source§type Walker<'r, R: BorrowedReader + 'r> = GeometryWalker<'r, R>
type Walker<'r, R: BorrowedReader + 'r> = GeometryWalker<'r, R>
walk_revisioned. Read more