[−][src]Struct mvt::Feature
Features contain map geometry with related metadata.
A new Feature can be obtained with Layer.into_feature. After optionally adding an ID and tags, retrieve the Layer with the Feature added by calling Feature.into_layer.
Example
use mvt::{GeomEncoder,GeomType,Tile,Transform}; let mut tile = Tile::new(4096); let layer = tile.create_layer("First Layer"); let geom_data = GeomEncoder::new(GeomType::Point, Transform::new()) .point(1.0, 2.0) .point(7.0, 6.0) .encode()?; let feature = layer.into_feature(geom_data); // ... // add any tags or ID to the feature // ... let layer = feature.into_layer();
Methods
impl Feature
[src]
pub fn into_layer(self) -> Layer
[src]
Complete the feature, returning ownership of the layer.
pub fn set_id(&mut self, id: u64) -> Result<(), Error>
[src]
Set the feature ID.
pub fn add_tag_string(&mut self, key: &str, val: &str)
[src]
Add a tag of string type.
pub fn add_tag_double(&mut self, key: &str, val: f64)
[src]
Add a tag of double type.
pub fn add_tag_float(&mut self, key: &str, val: f32)
[src]
Add a tag of float type.
pub fn add_tag_int(&mut self, key: &str, val: i64)
[src]
Add a tag of int type.
pub fn add_tag_uint(&mut self, key: &str, val: u64)
[src]
Add a tag of uint type.
pub fn add_tag_sint(&mut self, key: &str, val: i64)
[src]
Add a tag of sint type.
pub fn add_tag_bool(&mut self, key: &str, val: bool)
[src]
Add a tag of bool type.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,