Struct geozero::mvt::tile::Feature

source ·
pub struct Feature {
    pub id: Option<u64>,
    pub tags: Vec<u32>,
    pub type: Option<i32>,
    pub geometry: Vec<u32>,
}
Expand description

Features are described in section 4.2 of the specification

Fields§

§id: Option<u64>§tags: Vec<u32>

Tags of this feature are encoded as repeated pairs of integers. A detailed description of tags is located in sections 4.2 and 4.4 of the specification

§type: Option<i32>

The type of geometry stored in this feature.

§geometry: Vec<u32>

Contains a stream of commands and parameters (vertices). A detailed description on geometry encoding is located in section 4.3 of the specification.

Implementations§

source§

impl Feature

source

pub fn id(&self) -> u64

Returns the value of id, or the default value if id is unset.

source

pub fn type(&self) -> GeomType

Returns the enum value of type, or the default if the field is unset or set to an invalid enum value.

source

pub fn set_type(&mut self, value: GeomType)

Sets type to the provided enum value.

Trait Implementations§

source§

impl Clone for Feature

source§

fn clone(&self) -> Feature

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Feature

source§

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

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

impl Default for Feature

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl FromWkb for Feature

source§

fn from_wkb<R: Read>(rdr: &mut R, dialect: WkbDialect) -> Result<Self>

Convert from WKB.
source§

impl GeozeroGeometry for Feature

source§

fn process_geom<P: GeomProcessor>(&self, processor: &mut P) -> Result<()>

Process geometry.
source§

fn dims(&self) -> CoordDimensions

Dimensions of geometry
source§

fn srid(&self) -> Option<i32>

SRID of geometry
source§

impl Message for Feature

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for Feature

source§

fn eq(&self, other: &Feature) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Feature

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToGdal for T
where T: GeozeroGeometry,

source§

fn to_gdal(&self) -> Result<Geometry, GeozeroError>

Convert to 2D GDAL geometry.
source§

fn to_gdal_ndim(&self, dims: CoordDimensions) -> Result<Geometry, GeozeroError>

Convert to GDAL geometry with dimensions.
source§

impl<T> ToGeo for T
where T: GeozeroGeometry,

source§

fn to_geo(&self) -> Result<Geometry, GeozeroError>

Convert to geo-types Geometry.
source§

impl<T> ToGeos for T
where T: GeozeroGeometry,

source§

fn to_geos(&self) -> Result<Geometry<'_>, GeozeroError>

Convert to GEOS geometry.
source§

impl<T> ToJson for T
where T: GeozeroGeometry,

source§

fn to_json(&self) -> Result<String, GeozeroError>

Convert to GeoJSON String.
source§

impl<T> ToMvt for T
where T: GeozeroGeometry,

source§

fn to_mvt( &self, extent: u32, left: f64, bottom: f64, right: f64, top: f64 ) -> Result<Feature, GeozeroError>

Convert to MVT geometry. Read more
source§

fn to_mvt_unscaled(&self) -> Result<Feature, GeozeroError>

Convert to MVT geometry with geometries in unmodified tile coordinate space.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToSvg for T
where T: GeozeroGeometry,

source§

fn to_svg(&self) -> Result<String, GeozeroError>

Convert to SVG geometry.
source§

fn to_svg_document(&self) -> Result<String, GeozeroError>

Convert to SVG document.
source§

impl<T> ToWkb for T
where T: GeozeroGeometry,

source§

fn to_wkb_dialect( &self, dialect: WkbDialect, dims: CoordDimensions, srid: Option<i32>, envelope: Vec<f64> ) -> Result<Vec<u8>, GeozeroError>

Convert to WKB dialect.
source§

fn to_wkb(&self, dims: CoordDimensions) -> Result<Vec<u8>>

Convert to OGC WKB.
source§

fn to_ewkb(&self, dims: CoordDimensions, srid: Option<i32>) -> Result<Vec<u8>>

Convert to EWKB.
source§

fn to_gpkg_wkb( &self, dims: CoordDimensions, srid: Option<i32>, envelope: Vec<f64> ) -> Result<Vec<u8>>

Convert to GeoPackage WKB.
source§

fn to_spatialite_wkb( &self, dims: CoordDimensions, srid: Option<i32>, envelope: Vec<f64> ) -> Result<Vec<u8>>

Convert to Spatialite WKB.
source§

fn to_mysql_wkb(&self, srid: Option<i32>) -> Result<Vec<u8>>

Convert to MySQL WKB.
source§

impl<T> ToWkt for T
where T: GeozeroGeometry,

source§

fn to_wkt(&self) -> Result<String, GeozeroError>

Convert to 2D WKT String.
source§

fn to_ewkt(&self, srid: Option<i32>) -> Result<String, GeozeroError>

Convert to EWKT String.
source§

fn to_wkt_ndim(&self, dims: CoordDimensions) -> Result<String, GeozeroError>

Convert to WKT String with dimensions.
source§

fn to_wkt_with_opts( &self, dialect: WktDialect, dims: CoordDimensions, srid: Option<i32> ) -> Result<String, GeozeroError>

Convert to WKT String with srid, dimensions and dialect.
source§

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

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more