A command line utility to optimize OSM PBF files for openrouteservice graph building.
10K+
Code: https://github.com/GIScience/osm-transform/
A command line tool to preprocess OpenStreetMap data for routing purposes. The tool reads an OpenStreetMap pbf file, filters data that is not relevant for routing (e.g. buildings) and produces a much smaller pbf file. At the same time, the tool enriches the data with information about the country the data is in and optionally with elevation data.
The output pbf file can be used e.g. for openrouteservice graph building.
Run all tests:
cargo test
Integration tests:
cargo test --test integration_test
cargo clean
cargo run -- <options>
To get help about the command line options, run:
cargo run -- -h
cargo clean
cargo build
Or a optimized, faster version (build is slower):
cargo clean
cargo build --release
The executable binaries created by cargo build or cargo build --release are located in the target/debug or target/release directory respectively.
You can run the executable with the same options as described above for running locally:
./target/debug/osm-transform <options>
./target/release/osm-transform <options>
Run docker build and tag the image with e.g. local/osm-transform:latest:
docker rmi local/osm-transform:latest # if you have an old image
docker build -t local/osm-transform:latest .
If you don't want to build a docker image yourself, you can use the prebuilt image from docker hub: heigit/osm-transform:latest.
In the other examples in this README, add replace local/osm-transform:latest with heigit/osm-transform:latest.
When running the docker image, you can add all command line options for the rust application behind the docker image name. E.g. you can get help by running the following command:
docker run --rm local/osm-transform:latest -h
In all other use cases than getting help, you want to process an input file and potentially enrich the data with
information from other files. Therefore you need to mount the directories containing the input files to the docker.
The following command mounts the directories ~/data/osm, ~/data/countries and ~/data/elevation to the docker
directories /app/osm, /app/countries and /app/elevation respectively.
You can mount whichever directories you want, but you need to adjust the paths in the command according to the
paths in the container:
docker run --rm \
-v ~/data/osm:/app/osm \
-v ~/data/countries:/app/countries \
-v ~/data/elevation:/app/elevation \
-v .:/app/out \
local/osm-transform:latest \
-i /app/osm/heidelberg.test.pbf \
-o /app/out/heidelberg.ot.pbf \
-c /app/countries/world_borders_idx_0_40 \
-e '/app/elevation/*/*.tif' \
-vvv
Content type
Image
Digest
sha256:568c334ee…
Size
29.4 MB
Last updated
about 1 month ago
docker pull heigit/osm-transformPulls:
7
Last week