osrmreader 0.1.1

A reader for *.osrm files that are used by the routing engine OSRM.
Documentation
  • Coverage
  • 64%
    16 out of 25 items documented1 out of 12 items with examples
  • Size
  • Source code size: 46.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • b-r-u/osrmreader
    4 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • b-r-u

osrmreader

A fast reader for the *.osrm file format.

These files are used by the routing engine OSRM and are usually extracted from OpenStreetMap data with the tool osrm-extract. An *.osrm file encodes the routing graph as nodes and edges.

Crates.io Documentation

Usage

Add this to your Cargo.toml:

[dependencies]
osrmreader = "0.1"

Example

Here's a simple example that prints all nodes and edges:

use osrmreader::{OsrmReader, Entry};

fn main() -> Result<(), std::io::Error> {
    let f = std::fs::File::open("tests/test.osrm")?;
    let mut reader = OsrmReader::new(f);

    for entry in reader.entries()? {
        match entry {
            Ok(Entry::Nodes(nodes)) => {
                // Read nodes
                for n in nodes {
                    println!("{:?}", n?);
                }
            },
            Ok(Entry::Edges(edges)) => {
                // Read edges
                for e in edges {
                    println!("{:?}", e?);
                }
            },
            _ => {},
        }
    }

    Ok(())
}

License

This project is licensed under either of

at your option.