Struct osmpbf::elements::Way [−][src]
pub struct Way<'a> { /* fields omitted */ }
Expand description
An OpenStreetMap way element (See OSM wiki).
A way contains an ordered list of node references that can be accessed with the refs
or the
raw_refs
method.
Implementations
Returns an iterator over the tags of this way (See OSM wiki). A tag is represented as a pair of strings (key and value).
Example
use osmpbf::*;
let reader = ElementReader::from_path("tests/test.osm.pbf")?;
reader.for_each(|element| {
if let Element::Way(way) = element {
for (key, value) in way.tags() {
println!("key: {}, value: {}", key, value);
}
}
})?;
pub fn refs(&self) -> WayRefIter<'a>ⓘNotable traits for WayRefIter<'a>impl<'a> Iterator for WayRefIter<'a> type Item = i64;
pub fn refs(&self) -> WayRefIter<'a>ⓘNotable traits for WayRefIter<'a>impl<'a> Iterator for WayRefIter<'a> type Item = i64;
impl<'a> Iterator for WayRefIter<'a> type Item = i64;
Returns an iterator over the references of this way. Each reference should correspond to a node id.
Returns a slice of delta coded node ids.
Returns an iterator over the tags of this way
(See OSM wiki).
A tag is represented as a pair of indices (key and value) to the stringtable of the current
PrimitiveBlock
.
Returns the raw stringtable. Elements in a PrimitiveBlock
do not store strings
themselves; instead, they just store indices to a common stringtable. By convention, the
contained strings are UTF-8 encoded but it is not safe to assume that (use
std::str::from_utf8
).
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Way<'a>
impl<'a> UnwindSafe for Way<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more