[−][src]Struct geojson_antimeridian_cut::Geometry
Geometry Objects
GeoJSON Format Specification § 3.1
Examples
Constructing a Geometry
:
use geojson::{Geometry, Value}; let geometry = Geometry::new( Value::Point(vec![7.428959, 1.513394]), );
Serializing a Geometry
to a GeoJSON string:
use geojson::{GeoJson, Geometry, Value}; use serde_json; let geometry = Geometry::new( Value::Point(vec![7.428959, 1.513394]), ); let geojson_string = geometry.to_string(); assert_eq!( "{\"coordinates\":[7.428959,1.513394],\"type\":\"Point\"}", geojson_string, );
Deserializing a GeoJSON string into a Geometry
:
use geojson::{GeoJson, Geometry, Value}; let geojson_str = "{\"coordinates\":[7.428959,1.513394],\"type\":\"Point\"}"; let geometry = match geojson_str.parse::<GeoJson>() { Ok(GeoJson::Geometry(g)) => g, _ => return, }; assert_eq!( Geometry::new( Value::Point(vec![7.428959, 1.513394]), ), geometry, );
Fields
bbox: Option<Vec<f64>>
Bounding Box
value: Value
foreign_members: Option<Map<String, Value>>
Foreign Members
Methods
impl Geometry
[src]
pub fn new(value: Value) -> Geometry
[src]
Returns a new Geometry
with the specified value
. bbox
and foreign_members
will be
set to None
.
impl Geometry
[src]
Trait Implementations
impl Debug for Geometry
[src]
impl Display for Geometry
[src]
impl From<Geometry> for GeoJson
[src]
impl<'de> Deserialize<'de> for Geometry
[src]
fn deserialize<D>(
deserializer: D
) -> Result<Geometry, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Geometry, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Serialize for Geometry
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralPartialEq for Geometry
[src]
impl PartialEq<Geometry> for Geometry
[src]
impl Clone for Geometry
[src]
Auto Trait Implementations
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnwindSafe for Geometry
impl RefUnwindSafe for Geometry
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,