[][src]Struct osmpbf::elements::Node

pub struct Node<'a> { /* fields omitted */ }

An OpenStreetMap node element (See OSM wiki).

Methods

impl<'a> Node<'a>[src]

pub fn id(&self) -> i64[src]

Returns the node id. It should be unique between nodes and might be negative to indicate that the element has not yet been uploaded to a server.

Important traits for TagIter<'a>
pub fn tags(&self) -> TagIter<'a>[src]

Returns an iterator over the tags of this node (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::Node(node) = element {
        for (key, value) in node.tags() {
            println!("key: {}, value: {}", key, value);
        }
    }
})?;

pub fn info(&self) -> Info<'a>[src]

Returns additional metadata for this element.

pub fn lat(&self) -> f64[src]

Returns the latitude coordinate in degrees.

pub fn lon(&self) -> f64[src]

Returns the longitude coordinate in degrees.

Important traits for RawTagIter<'a>
pub fn raw_tags(&self) -> RawTagIter<'a>[src]

Returns an iterator over the tags of this node (See OSM wiki). A tag is represented as a pair of indices (key and value) to the stringtable of the current PrimitiveBlock.

pub fn raw_stringtable(&self) -> &[Vec<u8>][src]

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

impl<'a> Clone for Node<'a>[src]

impl<'a> Debug for Node<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Node<'a>

impl<'a> Send for Node<'a>

impl<'a> Sync for Node<'a>

impl<'a> Unpin for Node<'a>

impl<'a> UnwindSafe for Node<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.