Skip to content

Add --output option to osrm-extract for custom output base path#7349

Merged
DennisOSRM merged 3 commits intoProject-OSRM:masterfrom
afarber:4930-osrm-extract-output
Feb 16, 2026
Merged

Add --output option to osrm-extract for custom output base path#7349
DennisOSRM merged 3 commits intoProject-OSRM:masterfrom
afarber:4930-osrm-extract-output

Conversation

@afarber
Copy link
Copy Markdown
Contributor

@afarber afarber commented Jan 30, 2026

Issue

Fixes #4930

This PR adds an -o / --output option to osrm-extract so users can specify a custom output base path. This allows using the same OSM file with different routing profiles to generate separate output files without needing symbolic links.

Example usage:

osrm-extract -p profiles/car.lua planet.osm.pbf -o /data/car                                                                   
osrm-extract -p profiles/bicycle.lua planet.osm.pbf -o /data/bicycle                                                           

Tasklist

Requirements / Relations

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a --output (-o) option to osrm-extract to allow users to specify a custom output base path for generated files. This addresses issue #4930, enabling users to extract the same OSM file with different routing profiles without creating symbolic links to the input file.

Changes:

  • Added output_path field to ExtractorConfig for storing the custom output base path
  • Modified osrm-extract CLI to accept --output/-o option and use it to set output file paths
  • Added unit test to verify extraction with custom output path
  • Updated documentation to explain the new feature with examples
  • Updated CHANGELOG.md with the new feature
  • Modified .gitignore pattern to handle test output files with custom names

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
include/extractor/extractor_config.hpp Added output_path field to store custom output base path
src/tools/extract.cpp Added CLI option parsing for --output/-o and logic to use custom path when provided
unit_tests/library/extract.cpp Added test case to verify extraction with custom output path
docs/profiles.md Added documentation section explaining how to use multiple profiles with the same input file
CHANGELOG.md Added entry documenting the new feature
.gitignore Updated pattern to ignore test output files with custom names (monaco*.osrm*)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread unit_tests/library/extract.cpp
Comment thread unit_tests/library/extract.cpp
@afarber afarber force-pushed the 4930-osrm-extract-output branch from 540fea6 to 0d11db1 Compare February 15, 2026 13:16
@DennisOSRM DennisOSRM merged commit 0b41f90 into Project-OSRM:master Feb 16, 2026
19 checks passed
@afarber afarber deleted the 4930-osrm-extract-output branch February 16, 2026 16:37
MarcelloPerathoner pushed a commit to MarcelloPerathoner/osrm-backend that referenced this pull request Feb 24, 2026
…ect-OSRM#7349)

* Add --output option to osrm-extract for custom output base path

* Verify more output files in custom output path extract test

---------

Co-authored-by: Dennis Luxen <info@project-osrm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to specify output file in osrm-extract

3 participants