[−][src]Struct osmptparser::Parser
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]
F: Fn(Relation) -> R + Sync + Send + Clone + 'static,
R: Send + 'static,
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ⓘNotable traits for ParserRelationIterator
impl Iterator for ParserRelationIterator type Item = Relation;
[src]
Notable traits for ParserRelationIterator
impl Iterator for ParserRelationIterator type Item = Relation;
Returns a sequential iterator that returns a Relation on each turn
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,