pub struct FeatureCollection {
pub features: Vec<GeoFeature>,
pub crs: Option<CrsMetadata>,
}Expand description
A GeoJSON FeatureCollection.
Fields§
§features: Vec<GeoFeature>The features contained in this collection.
crs: Option<CrsMetadata>Optional CRS metadata (non-standard extension, but widely used).
Implementations§
Source§impl FeatureCollection
impl FeatureCollection
Sourcepub fn add(&mut self, feature: GeoFeature)
pub fn add(&mut self, feature: GeoFeature)
Add a feature.
Sourcepub fn query_bbox(&self, bbox: &BoundingBox) -> Vec<&GeoFeature>
pub fn query_bbox(&self, bbox: &BoundingBox) -> Vec<&GeoFeature>
Return features whose geometry bounding box intersects bbox.
Sourcepub fn to_geojson(&self) -> String
pub fn to_geojson(&self) -> String
Serialise to a GeoJSON FeatureCollection string.
Sourcepub fn total_bounding_box(&self) -> Option<BoundingBox>
pub fn total_bounding_box(&self) -> Option<BoundingBox>
Compute the bounding box enclosing all features.
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§fn default() -> FeatureCollection
fn default() -> FeatureCollection
Returns the “default value” for a type. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.