Struct MapboxVectorFeature

Source
pub struct MapboxVectorFeature {
    pub id: Option<u64>,
    pub version: u16,
    pub properties: MapboxProperties,
    pub extent: usize,
    pub type: FeatureType,
    pub is_s2: bool,
    /* private fields */
}
Expand description

Mapbox specification for a Feature

Fields§

§id: Option<u64>

the id of the feature

§version: u16

the version of the vector tile

§properties: MapboxProperties

the properties

§extent: usize

the extent

§type: FeatureType

the feature type

§is_s2: bool

whether the feature is using the S2 spec. This isn’t used by most tooling and was replaced by the open spec

Implementations§

Source§

impl MapboxVectorFeature

Source

pub fn new( pbf: Rc<RefCell<Protobuf>>, is_s2: bool, extent: usize, version: u16, keys: Rc<RefCell<Vec<String>>>, values: Rc<RefCell<Vec<PrimitiveValue>>>, ) -> MapboxVectorFeature

Create a new MapboxVectorFeature

Trait Implementations§

Source§

impl Debug for MapboxVectorFeature

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&mut MapboxVectorFeature> for BaseVectorFeature

Source§

fn from(mvt: &mut MapboxVectorFeature) -> Self

Converts to this type from the input type.
Source§

impl ProtoRead for MapboxVectorFeature

Source§

fn read(&mut self, tag: u64, pb: &mut Protobuf)

The read method is used to read a field from a protobuf message. The tag parameter is used to determine which field to read into the struct. The pbf parameter is used to read the data in the appropriate format. Read more
Source§

impl VectorFeatureMethods for MapboxVectorFeature

Source§

fn id(&self) -> Option<u64>

get the feature id

Source§

fn version(&self) -> u16

get the feature version

Source§

fn properties(&self) -> Properties

get the feature properties

Source§

fn extent(&self) -> usize

get the feature extent

Source§

fn get_type(&self) -> OpenFeatureType

get the feature type

Source§

fn bbox(&self) -> Option<BBOX>

get the bbox

Source§

fn has_m_values(&self) -> bool

whether the feature has m values

Source§

fn is_points(&self) -> bool

whether the feature is a points type

Source§

fn is_lines(&self) -> bool

whether the feature is a line type

Source§

fn is_polygons(&self) -> bool

whether the feature is a polygon type

Source§

fn is_points_3d(&self) -> bool

whether the feature is a points 3D type

Source§

fn is_lines_3d(&self) -> bool

whether the feature is a line 3D type

Source§

fn is_polygons_3d(&self) -> bool

whether the feature is a polygon 3D type

Source§

fn load_points(&mut self) -> VectorPoints

regardless of the type, we return a flattend point array

Source§

fn load_lines(&mut self) -> VectorLinesWithOffset

an array of lines. The offsets will be set to 0

Source§

fn load_lines_3d(&mut self) -> VectorLines3DWithOffset

an array of 3D lines. The offsets will be set to 0

Source§

fn load_polys(&mut self) -> Vec<VectorLinesWithOffset>

an array of polys

Source§

fn load_polys_3d(&mut self) -> Vec<VectorLines3DWithOffset>

an array of 3D polys

Source§

fn load_geometry_flat(&mut self) -> (Vec<f64>, Vec<u32>)

(flattened geometry & tesslation if applicable, indices)

Source§

fn load_geometry(&mut self) -> VectorGeometry

load the geometry

Source§

fn read_indices(&mut self) -> Vec<u32>

load the indices

Source§

fn add_tessellation(&mut self, geometry: &mut Vec<f64>, multiplier: f64)

Add tessellation data to the geometry

Source§

fn add_tessellation_3d(&mut self, _geometry: &mut Vec<f64>, _multiplier: f64)

Add 3D tessellation data to the geometry

Source§

fn load_points_3d(&mut self) -> VectorPoints3D

regardless of the type, we return a flattend point3D array

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.