[−][src]Struct mvt::Feature
A Feature contains 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}; use pointy::Transform64; let tile = Tile::new(4096); let layer = tile.create_layer("First Layer"); let geom_data = GeomEncoder::new(GeomType::Point, Transform64::default()) .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();
Implementations
impl Feature
[src]
pub fn into_layer(self) -> Layer
[src]
Complete the feature, returning ownership of the layer.
pub fn layer(self) -> Layer
[src]
Get the layer, abandoning the feature.
pub fn set_id(&mut self, id: u64)
[src]
Set the feature ID.
pub fn num_tags(&self) -> usize
[src]
Get number of tags (count).
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
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,