Git Product home page Git Product logo

osm4routing2's Introduction

osm4routing2

This project is a rewrite in rust from https://github.com/Tristramg/osm4routing

It converts an OpenStreetMap file (in the .pbf format) into a CSV file.

Build

Get a rust distribution with cargo: https://www.rust-lang.org/en-US/downloads.html

Run cargo install osm4routing

You can now use osm4routing <some_osmfile.pbf> to generate the nodes.csv and edges.csv that represent the road network.

If you prefer running the application from the sources, and not installing it, you run

cargo run --release -- <path_to_your_osmfile.pbf>

The identifiers for nodes and edges are from OpenStreetMap.

The id property of an edge is unique, while the osm_id can be duplicated.

Importing in a database

If you prefer having the files in database, you can run the very basic import_postgres.sh script.

It supposes that a database osm4routing exists (otherwise modify it to your needs).

Using as a library

In order to use osm4routing as a library, add osm4routing = "*" in your Cargo.toml file in the [dependencies] section.

Use it:

let (nodes, edges) = osm4routing::read("some_data.osm.pbf")?;

If you wand to reject certain edges based on their tag, use the Reader (it also accepts "*" to reject every value):

let (nodes, edges) = osm4routing::Reader::new().reject("area", "yes").read("some_data.osm.pbf")?;

osm4routing2's People

Contributors

andrewgy8 avatar antoine-de avatar jcoupey avatar tristramg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.