{"id":13417852,"url":"https://github.com/Project-OSRM/osrm-backend","last_synced_at":"2025-03-15T02:31:48.832Z","repository":{"id":1707125,"uuid":"2436255","full_name":"Project-OSRM/osrm-backend","owner":"Project-OSRM","description":"Open Source Routing Machine - C++ backend","archived":false,"fork":false,"pushed_at":"2024-10-27T14:10:05.000Z","size":49105,"stargazers_count":6383,"open_issues_count":434,"forks_count":3386,"subscribers_count":222,"default_branch":"master","last_synced_at":"2024-10-29T14:03:52.763Z","etag":null,"topics":["c-plus-plus","cpp","cpp17","isochrones","map-matching","openstreetmap","osm","osrm","routing","routing-engine","traveling-salesman"],"latest_commit_sha":null,"homepage":"http://map.project-osrm.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Project-OSRM.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.TXT","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-22T10:05:08.000Z","updated_at":"2024-10-29T08:41:30.000Z","dependencies_parsed_at":"2024-03-14T22:56:12.935Z","dependency_job_id":"7512851e-d45a-4531-ab0c-7bb6a816ab67","html_url":"https://github.com/Project-OSRM/osrm-backend","commit_stats":{"total_commits":8150,"total_committers":212,"mean_commits":"38.443396226415096","dds":0.794723926380368,"last_synced_commit":"3614af7f6429ee35c3f2e836513b784a74664ab6"},"previous_names":["dennisosrm/project-osrm"],"tags_count":243,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Project-OSRM%2Fosrm-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Project-OSRM%2Fosrm-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Project-OSRM%2Fosrm-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Project-OSRM%2Fosrm-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Project-OSRM","download_url":"https://codeload.github.com/Project-OSRM/osrm-backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243675005,"owners_count":20329191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cpp","cpp17","isochrones","map-matching","openstreetmap","osm","osrm","routing","routing-engine","traveling-salesman"],"created_at":"2024-07-30T22:00:54.009Z","updated_at":"2025-03-15T02:31:48.820Z","avatar_url":"https://github.com/Project-OSRM.png","language":"C++","readme":"## Open Source Routing Machine\n\n\n[![osrm-backend CI](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml/badge.svg)](https://github.com/Project-OSRM/osrm-backend/actions/workflows/osrm-backend.yml) [![Discord](https://img.shields.io/discord/1034487840219860992)](https://discord.gg/es9CdcCXcb)\n\nHigh performance routing engine written in C++ designed to run on OpenStreetMap data.\n\nThe following services are available via HTTP API, C++ library interface and NodeJs wrapper:\n- Nearest - Snaps coordinates to the street network and returns the nearest matches\n- Route - Finds the fastest route between coordinates\n- Table - Computes the duration or distances of the fastest route between all pairs of supplied coordinates\n- Match - Snaps noisy GPS traces to the road network in the most plausible way\n- Trip - Solves the Traveling Salesman Problem using a greedy heuristic\n- Tile - Generates Mapbox Vector Tiles with internal routing metadata\n\nTo quickly try OSRM use our [demo server](http://map.project-osrm.org) which comes with both the backend and a frontend on top.\n\nFor a quick introduction about how the road network is represented in OpenStreetMap and how to map specific road network features have a look at [the OSM wiki on routing](https://wiki.openstreetmap.org/wiki/Routing) or [this guide about mapping for navigation](https://web.archive.org/web/20221206013651/https://labs.mapbox.com/mapping/mapping-for-navigation/).\n\nRelated [Project-OSRM](https://github.com/Project-OSRM) repositories:\n- [osrm-frontend](https://github.com/Project-OSRM/osrm-frontend) - User-facing frontend with map. The demo server runs this on top of the backend\n- [osrm-text-instructions](https://github.com/Project-OSRM/osrm-text-instructions) - Text instructions from OSRM route response\n- [osrm-backend-docker](https://github.com/project-osrm/osrm-backend/pkgs/container/osrm-backend) - Ready to use Docker images\n\n## Documentation\n\n### Full documentation\n\n- [Hosted documentation](http://project-osrm.org)\n- [osrm-routed HTTP API documentation](docs/http.md)\n- [libosrm API documentation](docs/libosrm.md)\n\n## Contact\n\n- Discord: [join](https://discord.gg/es9CdcCXcb)\n- IRC: `irc.oftc.net`, channel: `#osrm` ([Webchat](https://webchat.oftc.net))\n- Mailinglist: `https://lists.openstreetmap.org/listinfo/osrm-talk`\n\n## Quick Start\n\nThe easiest and quickest way to setup your own routing engine is to use Docker images we provide.\n\nThere are two pre-processing pipelines available:\n- Contraction Hierarchies (CH)\n- Multi-Level Dijkstra (MLD)\n\nwe recommend using MLD by default except for special use-cases such as very large distance matrices where CH is still a better fit for the time being.\nIn the following we explain the MLD pipeline.\nIf you want to use the CH pipeline instead replace `osrm-partition` and `osrm-customize` with a single `osrm-contract` and change the algorithm option for `osrm-routed` to `--algorithm ch`.\n\n### Using Docker\n\nWe base our Docker images ([backend](https://github.com/Project-OSRM/osrm-backend/pkgs/container/osrm-backend), [frontend](https://hub.docker.com/r/osrm/osrm-frontend/)) on Debian and make sure they are as lightweight as possible. Older backend versions can be found on [Docker Hub](https://hub.docker.com/r/osrm/osrm-backend/).\n\nDownload OpenStreetMap extracts for example from [Geofabrik](http://download.geofabrik.de/)\n\n    wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf\n\nPre-process the extract with the car profile and start a routing engine HTTP server on port 5000\n\n    docker run -t -v \"${PWD}:/data\" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf || echo \"osrm-extract failed\"\n\nThe flag `-v \"${PWD}:/data\"` creates the directory `/data` inside the docker container and makes the current working directory `\"${PWD}\"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `\"${PWD}/berlin-latest.osm.pbf\"` on the host. Noting that this process can take a long time to complete with little changes on the terminal output, for example, a Mexico's OSM file of 550.7MB took around 30 minutes to finish extraction and generate edge-expanded graph representation.\n\n    docker run -t -v \"${PWD}:/data\" ghcr.io/project-osrm/osrm-backend osrm-partition /data/berlin-latest.osrm || echo \"osrm-partition failed\"\n    docker run -t -v \"${PWD}:/data\" ghcr.io/project-osrm/osrm-backend osrm-customize /data/berlin-latest.osrm || echo \"osrm-customize failed\"\n\nNote there is no `berlin-latest.osrm` file, but multiple `berlin-latest.osrm.*` files, i.e. `berlin-latest.osrm` is not file path, but \"base\" path referring to set of files and there is an option to omit this `.osrm` suffix completely(e.g. `osrm-partition /data/berlin-latest`).\n\n    docker run -t -i -p 5000:5000 -v \"${PWD}:/data\" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm\n\nMake requests against the HTTP server\n\n    curl \"http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true\"\n\nOptionally start a user-friendly frontend on port 9966, and open it up in your browser\n\n    docker run -p 9966:9966 osrm/osrm-frontend\n    xdg-open 'http://127.0.0.1:9966'\n\nIn case Docker complains about not being able to connect to the Docker daemon make sure you are in the `docker` group.\n\n    sudo usermod -aG docker $USER\n\nAfter adding yourself to the `docker` group make sure to log out and back in again with your terminal.\n\nWe support the following images in the Container Registry:\n\nName | Description\n-----|------\n`latest` | `master` compiled with release flag\n`latest-assertions` | `master` compiled with with release flag, assertions enabled and debug symbols\n`latest-debug` | `master` compiled with debug flag\n`\u003ctag\u003e` | specific tag compiled with release flag\n`\u003ctag\u003e-debug` | specific tag compiled with debug flag\n\n### Building from Source\n\nThe following targets Ubuntu 22.04.\nFor instructions how to build on different distributions, macOS or Windows see our [Wiki](https://github.com/Project-OSRM/osrm-backend/wiki).\n\nInstall dependencies\n\n```bash\nsudo apt install build-essential git cmake pkg-config \\\nlibbz2-dev libxml2-dev libzip-dev libboost-all-dev \\\nlua5.2 liblua5.2-dev libtbb-dev\n```\n\nCompile and install OSRM binaries\n\n```bash\nmkdir -p build\ncd build\ncmake ..\ncmake --build .\nsudo cmake --build . --target install\n```\n\n### Request Against the Demo Server\n\nRead the [API usage policy](https://github.com/Project-OSRM/osrm-backend/wiki/Demo-server).\n\nSimple query with instructions and alternatives on Berlin:\n\n```\ncurl \"https://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true\u0026alternatives=true\"\n```\n\n### Using the Node.js Bindings\n\nThe Node.js bindings provide read-only access to the routing engine.\nWe provide API documentation and examples [here](docs/nodejs/api.md).\n\nYou will need a modern `libstdc++` toolchain (`\u003e= GLIBCXX_3.4.26`) for binary compatibility if you want to use the pre-built binaries.\nFor older Ubuntu systems you can upgrade your standard library for example with:\n\n```\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\nsudo apt-get update -y\nsudo apt-get install -y libstdc++-9-dev\n```\n\nYou can install the Node.js bindings via `npm install @project-osrm/osrm` or from this repository either via\n\n    npm install\n\nwhich will check and use pre-built binaries if they're available for this release and your Node version, or via\n\n    npm install --build-from-source\n\nto always force building the Node.js bindings from source.\n\n#### Unscoped packages\n\nPrior to v5.27.0, the `osrm` Node package was unscoped. If you are upgrading from an old package, you will need to do the following:\n\n```\nnpm uninstall osrm --save\nnpm install @project-osrm/osrm --save\n```\n\n#### Package docs\n\nFor usage details have a look [these API docs](docs/nodejs/api.md).\n\nAn exemplary implementation by a 3rd party with Docker and Node.js can be found [here](https://github.com/door2door-io/osrm-express-server-demo).\n\n\n## References in publications\n\nWhen using the code in a (scientific) publication, please cite\n\n```\n@inproceedings{luxen-vetter-2011,\n author = {Luxen, Dennis and Vetter, Christian},\n title = {Real-time routing with OpenStreetMap data},\n booktitle = {Proceedings of the 19th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems},\n series = {GIS '11},\n year = {2011},\n isbn = {978-1-4503-1031-4},\n location = {Chicago, Illinois},\n pages = {513--516},\n numpages = {4},\n url = {http://doi.acm.org/10.1145/2093973.2094062},\n doi = {10.1145/2093973.2094062},\n acmid = {2094062},\n publisher = {ACM},\n address = {New York, NY, USA},\n}\n```\n","funding_links":[],"categories":["TODO scan for Android support in followings","C++","Tools","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Simultaneous Localization and Mapping","Localization","Geographic search \u0026 routing System","Libraries"],"sub_categories":["C/C++","Vector Map","SLAM"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProject-OSRM%2Fosrm-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FProject-OSRM%2Fosrm-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProject-OSRM%2Fosrm-backend/lists"}