Struct earthwyrm::Wyrm

source ·
pub struct Wyrm { /* private fields */ }
Expand description

Wyrm tile fetcher.

To create:

  • Use serde to deserialize a WyrmCfg
  • let wyrm = Wyrm::try_from(wyrm_cfg)?;

Implementations§

source§

impl Wyrm

source

pub fn query_features(&self, bbox: BBox<f64>) -> Result<(), Error>

Query features in a bounding box

source

pub fn fetch_tile<W: Write>( &self, out: &mut W, group_name: &str, tid: TileId ) -> Result<(), Error>

Fetch one tile.

  • out Writer to write MVT data.
  • group_name Name of layer group.
  • tid Tile ID.
Examples found in repository?
examples/one_tile.rs (line 30)
21
22
23
24
25
26
27
28
29
30
31
32
fn write_tile(
    x: u32,
    y: u32,
    z: u32,
) -> Result<(), Box<dyn std::error::Error>> {
    let wyrm_cfg: WyrmCfg = muon_rs::from_str(MUON)?;
    let wyrm = Wyrm::try_from(&wyrm_cfg)?;
    let mut file = File::create("./one_tile.mvt")?;
    let tid = TileId::new(x, y, z)?;
    wyrm.fetch_tile(&mut file, "tile", tid)?;
    Ok(())
}

Trait Implementations§

source§

impl TryFrom<&WyrmCfg> for Wyrm

§

type Error = Error

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

fn try_from(wyrm_cfg: &WyrmCfg) -> Result<Self, Error>

Performs the conversion.

Auto Trait Implementations§

§

impl RefUnwindSafe for Wyrm

§

impl Send for Wyrm

§

impl Sync for Wyrm

§

impl Unpin for Wyrm

§

impl UnwindSafe for Wyrm

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

§

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.