Struct gdal::vector::OwnedLayer

source ·
pub struct OwnedLayer { /* private fields */ }
Expand description

Layer in a vector dataset

use std::path::Path;
use gdal::Dataset;
use gdal::vector::LayerAccess;

let dataset = Dataset::open(Path::new("fixtures/roads.geojson")).unwrap();
let mut layer = dataset.into_layer(0).unwrap();
for feature in layer.features() {
    // do something with each feature
}

Implementations

Returns iterator over the features in this layer.

Note. This method resets the current index to the beginning before iteration. It also borrows the layer mutably, preventing any overlapping borrows.

Returns the Dataset this layer belongs to and consumes this layer.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Returns the C wrapped pointer Read more
Returns the feature with the given feature id fid, or None if not found. Read more
Returns iterator over the features in this layer. Read more
Set a feature on this layer layer. ReferSetFeature Read more
Set a spatial filter on this layer. Read more
Set a spatial rectangle filter on this layer by specifying the bounds of a rectangle.
Clear spatial filters set on this layer.
Get the name of this layer.
Returns the number of features in this layer, even if it requires expensive calculation. Read more
Returns the number of features in this layer, if it is possible to compute this efficiently. Read more
Returns the extent of this layer as an axis-aligned bounding box, even if it requires expensive calculation. Read more
Returns the extent of this layer as an axis-aligned bounding box, if it is possible to compute this efficiently. Read more
Fetch the spatial reference system for this layer. Read more
Set a new attribute query that restricts features when using the feature iterator. Read more
Clear the attribute filter set on this layer Read more

As long we have a 1:1 mapping between a dataset and a layer, it is Send. We cannot allow a layer to be send, when two or more access (and modify) the same Dataset.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.