{"id":13701280,"url":"https://github.com/mapbox/osrm-matching-inspection","last_synced_at":"2026-01-11T09:59:50.737Z","repository":{"id":25274699,"uuid":"28700300","full_name":"mapbox/osrm-matching-inspection","owner":"mapbox","description":"Tool to inspect matching generated by the road-network matching plugin in OSRM","archived":true,"fork":false,"pushed_at":"2023-03-24T09:37:14.000Z","size":539,"stargazers_count":25,"open_issues_count":2,"forks_count":8,"subscribers_count":120,"default_branch":"master","last_synced_at":"2025-04-21T08:56:55.550Z","etag":null,"topics":["banished"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2015-01-02T01:27:11.000Z","updated_at":"2024-01-12T14:24:51.000Z","dependencies_parsed_at":"2024-11-13T07:41:57.034Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/osrm-matching-inspection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fosrm-matching-inspection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fosrm-matching-inspection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fosrm-matching-inspection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fosrm-matching-inspection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/osrm-matching-inspection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252403670,"owners_count":21742407,"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":["banished"],"created_at":"2024-08-02T20:01:26.451Z","updated_at":"2025-12-17T10:20:55.771Z","avatar_url":"https://github.com/mapbox.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Matching inspection\n\nThese scripts can be used to inspect matchings generated by the [map matching](https://github.com/Project-OSRM/osrm-backend/tree/feature/matching) plugin for OSRM.\n\n## Installation\n\nThere are two ways to install the server side component. One involves building `osrm-backend` and `node-osrm` from source and one needs binary packges of a special `node-osrm` version.\n\n### From binary package\n\n    npm install osrm\n\nWhich downloads a binary package if it is available on your platform.\n\n### From source\n\nCompile OSRM with debug support:\n\n```\ngit clone https://github.com/Project-OSRM/osrm-backend.git\ncd osrm-backend\nmkdir -p build\ncd build\ncmake -DENABLE_JSON_LOGGING=1 .. \nmake \u0026\u0026 sudo make install\n```\n\nRun:\n\n    npm install osrm --build-from-source\n\nTo download and compile `node-osrm` from source.\n\n## Client side components\n\nRun:\n\n    bower install \u0026\u0026 make\n\nTo install the front-end components.\n\n## Importing traces\n\nTo import traces in ```GPX``` or ```CSV``` format contained in a folder ```data``` to the labeling database run:\n\n    node bin/server.js data\n\nThis will create a file ```data/clasification_db.sqlite``` which will contain a list of all traces and their classification.\n\n## Starting the frontend\n\nAssuming your GPX traces are contained in a folder ```data``` in the current repository root:\n\nLocally run:\n\n    node bin/server.js data path/to/dataset.osrm\n\nAlternatively if you want to use ```osrm-routed``` instead of node-osrm just run:\n\n    node bin/server.js data\n\nWhich expects a ```osrm-routed``` server listening on ```http://127.0.0.1:5000```.\n\nNow you can view the frontend on ```http://127.0.0.1:8337``` in your browser. It will look somewhat like this:\n\n![](http://i.imgur.com/XvMjiVC.png)\n\nWhich shows an interactive trellis diagram of the matching. Select a state pair to view the transition probabilities\nand Viterbi values.\n\nYou can use the left and right arrow key to cycle through the traces.\n\n## Classification\n\nOpening ```http://127.0.0.1:8337/classify.html``` will display a minimal interface for easy classification.\nPressing 0 will classify as ```unknown```, 1 as ```valid``` and ```2``` as invalid.\n\nThe labels will be saved in ```classification_db.sqlite``` which can be used by ```bin/test_classification.js``` to verify the classifier\nimplemented inside the OSRM plugin.\n```bin/test_classification.js``` will also generate ```tested_db.json``` which is needed by ```bin/calibrate_classification.py``` to derive better classification values.\n\n## Batch matching\n\nYou can batch match a dataset using ```bin/traces2geojson.js data \u003e matched.geojson``` which produces a geojson file containg the following features:\n\nFor every sub-matchings:\n```js\n{\n        \"type\": \"Feature\",\n        \"geometry\": {\n            \"type\": \"LineString\",\n            \"coordinates\": [[lon, lat], ...],\n        },\n        \"properties\": {\n            \"type\": \"matching\"\n            file: \"path/to/file\"\n            confidence: 0.5 # in [0, 1] -\u003e 1 means very confident, 0 means no confidence\n        }\n}\n```\n\nFor every trace fragment:\n```js\n{\n        \"type\": \"Feature\",\n        \"geometry\": {\n            \"type\": \"LineString\",\n            \"coordinates\": [[lon, lat], ...],\n        },\n        \"properties\": {\n            \"type\": \"trace\"\n            file: \"path/to/file\"\n            confidence: 0.5 # confidence of the corresponding sub-trace\n        }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fosrm-matching-inspection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Fosrm-matching-inspection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fosrm-matching-inspection/lists"}