pub enum Value {
Point(PointType),
MultiPoint(Vec<PointType>),
LineString(LineStringType),
MultiLineString(Vec<LineStringType>),
Polygon(PolygonType),
MultiPolygon(Vec<PolygonType>),
GeometryCollection(Vec<Geometry>),
}Expand description
The underlying value for a Geometry.
§Conversion from geo_types
A Value can be created by using the From impl which is available for both geo_types
primitives AND geo_types::Geometry enum members:
let point = geo_types::Point::new(2., 9.);
let genum = geo_types::Geometry::from(point);
assert_eq!(
geojson::Value::from(&point),
geojson::Value::Point(vec![2., 9.]),
);
assert_eq!(
geojson::Value::from(&genum),
geojson::Value::Point(vec![2., 9.]),
);Variants§
Point(PointType)
MultiPoint(Vec<PointType>)
MultiPoint
LineString(LineStringType)
LineString
MultiLineString(Vec<LineStringType>)
MultiLineString
Polygon(PolygonType)
MultiPolygon(Vec<PolygonType>)
MultiPolygon
GeometryCollection(Vec<Geometry>)
GeometryCollection
Implementations§
Source§impl Value
impl Value
pub fn from_json_object(object: JsonObject) -> Result<Self>
pub fn from_json_value(value: JsonValue) -> Result<Self>
Trait Implementations§
Source§impl<'a, T> From<&'a Geometry<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<'a, T> From<&'a Geometry<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> From<&GeometryCollection<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&GeometryCollection<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§fn from(geometry_collection: &GeometryCollection<T>) -> Self
fn from(geometry_collection: &GeometryCollection<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<&Line<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&Line<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> From<&LineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&LineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§fn from(line_string: &LineString<T>) -> Self
fn from(line_string: &LineString<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<&MultiLineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&MultiLineString<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§fn from(multi_line_string: &MultiLineString<T>) -> Self
fn from(multi_line_string: &MultiLineString<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<&MultiPoint<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&MultiPoint<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§fn from(multi_point: &MultiPoint<T>) -> Self
fn from(multi_point: &MultiPoint<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<&MultiPolygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&MultiPolygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§fn from(multi_polygon: &MultiPolygon<T>) -> Self
fn from(multi_polygon: &MultiPolygon<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<&Point<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&Point<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> From<&Polygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&Polygon<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> From<&Rect<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&Rect<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> From<&Triangle<T>> for Valuewhere
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> From<&Triangle<T>> for Valuewhere
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<'a> From<&'a Value> for JsonObject
impl<'a> From<&'a Value> for JsonObject
Source§fn from(value: &'a Value) -> JsonObject
fn from(value: &'a Value) -> JsonObject
Converts to this type from the input type.
Source§impl<T> TryFrom<&Value> for Geometry<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for Geometry<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for GeometryCollection<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for GeometryCollection<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for LineString<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for LineString<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for MultiLineString<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for MultiLineString<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for MultiPoint<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for MultiPoint<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for MultiPolygon<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for MultiPolygon<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for Point<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for Point<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T> TryFrom<&Value> for Polygon<T>where
T: CoordFloat,
Available on crate feature geo-types only.
impl<T> TryFrom<&Value> for Polygon<T>where
T: CoordFloat,
Available on crate feature
geo-types only.Source§impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
Available on crate feature geo-types only.
impl<T: CoordFloat> TryFrom<Value> for GeometryCollection<T>
Available on crate feature
geo-types only.Source§impl<T: CoordFloat> TryFrom<Value> for LineString<T>
Available on crate feature geo-types only.
impl<T: CoordFloat> TryFrom<Value> for LineString<T>
Available on crate feature
geo-types only.Source§impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
Available on crate feature geo-types only.
impl<T: CoordFloat> TryFrom<Value> for MultiLineString<T>
Available on crate feature
geo-types only.Source§impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
Available on crate feature geo-types only.
impl<T: CoordFloat> TryFrom<Value> for MultiPoint<T>
Available on crate feature
geo-types only.Source§impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
Available on crate feature geo-types only.
impl<T: CoordFloat> TryFrom<Value> for MultiPolygon<T>
Available on crate feature
geo-types only.impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
Mutably borrows from an owned value. Read more