pub struct GpkgFeature { /* private fields */ }Expand description
A single feature with geometry bytes and owned properties.
Implementations§
Source§impl GpkgFeature
impl GpkgFeature
Sourcepub fn id(&self) -> i64
pub fn id(&self) -> i64
Return the primary key value.
Example:
use rusqlite_gpkg::Gpkg;
let gpkg = Gpkg::open_read_only("data/example.gpkg")?;
let layer = gpkg.get_layer("points")?;
let features = layer.features()?;
let feature = features.first().expect("feature");
let _id = feature.id();Sourcepub fn geometry(&self) -> Result<Wkb<'_>>
pub fn geometry(&self) -> Result<Wkb<'_>>
Decode the geometry column into WKB.
Example:
use rusqlite_gpkg::Gpkg;
let gpkg = Gpkg::open_read_only("data/example.gpkg")?;
let layer = gpkg.get_layer("points")?;
let features = layer.features()?;
let feature = features.first().expect("feature");
let _geom = feature.geometry()?;Sourcepub fn property(&self, name: &str) -> Option<Value>
pub fn property(&self, name: &str) -> Option<Value>
Read a property by name as an owned Value.
Example:
use rusqlite_gpkg::Gpkg;
let gpkg = Gpkg::open_read_only("data/example.gpkg")?;
let layer = gpkg.get_layer("points")?;
let features = layer.features()?;
let feature = features.first().expect("feature");
let value: String = feature
.property("name")
.ok_or("missing name")?
.try_into()?;Sourcepub fn properties(&self) -> &[Value]
pub fn properties(&self) -> &[Value]
Return the ordered property values as stored in the feature.
Auto Trait Implementations§
impl Freeze for GpkgFeature
impl RefUnwindSafe for GpkgFeature
impl !Send for GpkgFeature
impl !Sync for GpkgFeature
impl Unpin for GpkgFeature
impl UnwindSafe for GpkgFeature
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