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
impl Wyrm
sourcepub fn query_features(&self, bbox: BBox<f64>) -> Result<(), Error>
pub fn query_features(&self, bbox: BBox<f64>) -> Result<(), Error>
Query features in a bounding box
sourcepub fn fetch_tile<W: Write>(
&self,
out: &mut W,
group_name: &str,
tid: TileId
) -> Result<(), Error>
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more