[][src]Struct osmptparser::Parser

pub struct Parser { /* fields omitted */ }

Main class that parses a pbf file and maintains a cache of relations/ways/nodes then provides methods to access the public transports (PTv2) inside that (cached) file

Implementations

impl Parser[src]

Main class, it parses the pbf file on new() and maintains an internal cache of relations / ways / nodes, to build on the fly PublicTransport representations

pub fn new(pbf_filename: &str, cpus: usize) -> Self[src]

creates internal cache by parsing the pbf file in the pbf_filename path, in parallel with cpus threads

pub fn get_public_transports(&self, gap: f64) -> Vec<PublicTransport>[src]

Builds a vector in parallel with all the public transport ways normalized and "fixed". It works in parallel using the same amount of threads that were configured on new()

pub fn par_map<R, F>(&self, func: &F) -> Vec<R> where
    F: Fn(Relation) -> R + Sync + Send + Clone + 'static,
    R: Send + 'static, 
[src]

Iterates in parallel through the cache of public transports and offers the possibility to further process them with the func function being executed in parallel It works in parallel using the same amount of threads that were configured on new()

pub fn get_relation_from_id(self, id: u64) -> Relation[src]

Builds the Relation from the provided osm_id id

pub fn get_at(&self, index: usize) -> Relation[src]

Builds the Relation at position index in the internal cache

pub fn iter(self) -> ParserRelationIterator[src]

Returns a sequential iterator that returns a Relation on each turn

Trait Implementations

impl Clone for Parser[src]

impl Debug for Parser[src]

impl IntoIterator for Parser[src]

type Item = Relation

The type of the elements being iterated over.

type IntoIter = ParserRelationIterator

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl RefUnwindSafe for Parser

impl Send for Parser

impl Sync for Parser

impl Unpin for Parser

impl UnwindSafe for Parser

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.