[][src]Struct mvt::Feature

pub struct Feature { /* fields omitted */ }

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

impl Send for Feature

impl Sync for Feature

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]