Struct BaseVectorLayer

Source
pub struct BaseVectorLayer {
    pub version: u8,
    pub name: String,
    pub extent: Extent,
    pub shape_defined: bool,
    pub m_shape_defined: bool,
    pub shape: Shape,
    pub m_shape: Option<Shape>,
    pub features: Vec<BaseVectorFeature>,
}
Expand description

Base Vector Layer This is an intermediary for storing layer data in the Open Vector Tile format.

Fields§

§version: u8

the version of the vector tile. This is a number that tracks the OVT specification. and shouldn’t be tampered with

§name: String

the name of the layer

§extent: Extent

the extent of the vector tile (only 512, 1_024, 2_048, 4_096, and 8_192 are supported)

§shape_defined: bool

if the shape was already passed in to the constructor

§m_shape_defined: bool

if the M-Shape was already passed in to the constructor

§shape: Shape

The shape used to describe the features properties in the layer

§m_shape: Option<Shape>

the shape of each feature’s M-Values

§features: Vec<BaseVectorFeature>

the features in the layer

Implementations§

Source§

impl BaseVectorLayer

Source

pub fn new( name: String, extent: Extent, features: Vec<BaseVectorFeature>, shape: Option<Shape>, m_shape: Option<Shape>, ) -> Self

Create a new BaseVectorLayer

Source

pub fn add_feature(&mut self, feature: BaseVectorFeature)

Add a new feature to the layer

Source

pub fn feature(&self, i: usize) -> &BaseVectorFeature

Get the feature at the given index

Source

pub fn len(&self) -> usize

Get the number of features

Source

pub fn is_empty(&self) -> bool

Check if the layer is empty

Trait Implementations§

Source§

impl Debug for BaseVectorLayer

Source§

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

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

impl From<&mut MapboxVectorLayer> for BaseVectorLayer

Source§

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

Converts to this type from the input type.

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.