pub struct FeatureCollection {
pub collection_type: String,
pub features: Vec<Feature>,
pub bbox: Option<BBox>,
pub crs: Option<Crs>,
pub foreign_members: Option<ForeignMembers>,
}Expand description
GeoJSON FeatureCollection
A FeatureCollection is a collection of Feature objects.
Fields§
§collection_type: StringType discriminator (always “FeatureCollection”)
features: Vec<Feature>The features in the collection
bbox: Option<BBox>Optional bounding box
crs: Option<Crs>Optional CRS (deprecated in RFC 7946 but still supported)
foreign_members: Option<ForeignMembers>Foreign members (additional properties)
Implementations§
Source§impl FeatureCollection
impl FeatureCollection
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a FeatureCollection with capacity
Sourcepub fn add_feature(&mut self, feature: Feature)
pub fn add_feature(&mut self, feature: Feature)
Adds a feature to the collection
Sourcepub fn add_features(&mut self, features: Vec<Feature>)
pub fn add_features(&mut self, features: Vec<Feature>)
Adds multiple features to the collection
Sourcepub fn compute_bbox(&mut self)
pub fn compute_bbox(&mut self)
Computes and sets the bounding box from all features
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Feature>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Feature>
Returns a mutable iterator over the features
Sourcepub fn with_property(&self, key: &str, value: &Value) -> Self
pub fn with_property(&self, key: &str, value: &Value) -> Self
Returns features with a specific property value
Trait Implementations§
Source§impl Clone for FeatureCollection
impl Clone for FeatureCollection
Source§fn clone(&self) -> FeatureCollection
fn clone(&self) -> FeatureCollection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureCollection
impl Debug for FeatureCollection
Source§impl Default for FeatureCollection
impl Default for FeatureCollection
Source§impl<'de> Deserialize<'de> for FeatureCollection
impl<'de> Deserialize<'de> for FeatureCollection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<Feature> for FeatureCollection
impl FromIterator<Feature> for FeatureCollection
Source§impl<'a> IntoIterator for &'a FeatureCollection
impl<'a> IntoIterator for &'a FeatureCollection
Source§impl<'a> IntoIterator for &'a mut FeatureCollection
impl<'a> IntoIterator for &'a mut FeatureCollection
Source§impl IntoIterator for FeatureCollection
impl IntoIterator for FeatureCollection
Source§impl PartialEq for FeatureCollection
impl PartialEq for FeatureCollection
Source§impl Serialize for FeatureCollection
impl Serialize for FeatureCollection
impl StructuralPartialEq for FeatureCollection
Auto Trait Implementations§
impl Freeze for FeatureCollection
impl RefUnwindSafe for FeatureCollection
impl Send for FeatureCollection
impl Sync for FeatureCollection
impl Unpin for FeatureCollection
impl UnsafeUnpin for FeatureCollection
impl UnwindSafe for FeatureCollection
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