{"id":13425745,"url":"https://github.com/graphhopper/map-matching","last_synced_at":"2025-10-05T01:31:34.781Z","repository":{"id":24411736,"uuid":"27812454","full_name":"graphhopper/map-matching","owner":"graphhopper","description":"The map matching functionality is now located in the main repository https://github.com/graphhopper/graphhopper#map-matching","archived":true,"fork":false,"pushed_at":"2020-12-02T07:52:10.000Z","size":9367,"stargazers_count":788,"open_issues_count":26,"forks_count":272,"subscribers_count":63,"default_branch":"master","last_synced_at":"2024-12-03T23:06:07.063Z","etag":null,"topics":["geospatial","gps","java","map-matching","openstreetmap","tracking"],"latest_commit_sha":null,"homepage":"https://www.graphhopper.com/open-source/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphhopper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-10T09:38:00.000Z","updated_at":"2024-12-01T05:16:51.000Z","dependencies_parsed_at":"2022-07-13T07:20:27.822Z","dependency_job_id":null,"html_url":"https://github.com/graphhopper/map-matching","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fmap-matching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fmap-matching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fmap-matching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphhopper%2Fmap-matching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphhopper","download_url":"https://codeload.github.com/graphhopper/map-matching/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235348665,"owners_count":18975704,"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":["geospatial","gps","java","map-matching","openstreetmap","tracking"],"created_at":"2024-07-31T00:01:17.881Z","updated_at":"2025-10-05T01:31:29.027Z","avatar_url":"https://github.com/graphhopper.png","language":"Java","readme":"## Map Matching based on GraphHopper\n\n[![Build Status](https://secure.travis-ci.org/graphhopper/map-matching.png?branch=master)](http://travis-ci.org/graphhopper/map-matching)\n\nSnaps GPX traces to the road using the\n[GraphHopper routing engine](https://github.com/graphhopper/graphhopper). \n        \nRead more about the map matching problem at [Wikipedia](https://en.wikipedia.org/wiki/Map_matching). \n\nSee the demo in action (black is GPS track, green is matched result):\n\n![map-matching-example](https://cloud.githubusercontent.com/assets/129644/14740686/188a181e-0891-11e6-820c-3bd0a975f8a5.png)\n\n### License\n\nApache License 2.0\n\n### Discussion\n\nOur web forum is [here](https://discuss.graphhopper.com/c/graphhopper/map-matching).\n\n### Usage\n\nJava 8 and Maven \u003e=3.3 are required.\n\nBuild:\n\n```bash\nmvn package -DskipTests\n```\n\nThen you need to import an OSM map for the area you want to do map-matching on, e.g. the provided\nsample data:\n\n```bash\njava -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar import map-data/leipzig_germany.osm.pbf\n```\n\nOpenStreetMap data in pbf or xml format are available from [here](http://download.geofabrik.de/).\n\nThe optional parameter `--vehicle` defines the routing profile like `car`, `bike`, `motorcycle` or `foot`.\nYou can also provide a comma separated list. For all supported values see the variables in the [FlagEncoderFactory](https://github.com/graphhopper/graphhopper/blob/0.13/core/src/main/java/com/graphhopper/routing/util/FlagEncoderFactory.java) of GraphHopper.\n\nBefore re-importing, you need to delete the `graph-cache` directory, which is created by the import.\n\nNow you can match GPX traces against the map:\n```bash\njava -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar match matching-web/src/test/resources/*.gpx\n```\nIf you were using multiple vehicles for the import you can use `--vehicle` to select one of them, otherwise the first\none will be used.\n\n### Web app\n\nStart via:\n```bash\njava -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar server config.yml\n```\n\nAccess the simple UI via `localhost:8989`.\n\nYou can post GPX files and get back snapped results as GPX or as compatible GraphHopper JSON. An example curl request is:\n```bash\ncurl -XPOST -H \"Content-Type: application/gpx+xml\" -d @matching-web/src/test/resources/test1.gpx \"localhost:8989/match?vehicle=car\u0026type=json\"\n```\n\n#### Tools\n\nDetermine the bounding box of one or more GPX files:\n```bash\njava -jar matching-web/target/graphhopper-map-matching-web-3.0-SNAPSHOT.jar getbounds matching-web/src/test/resources/*.gpx\n```\n\n#### Java usage\n\nHave a look at `MapMatchingResource.java` to see how the web service is implemented on top\nof library functions to get an idea how to use map matching in your own project.\n\nUse this Maven dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.graphhopper\u003c/groupId\u003e\n    \u003cartifactId\u003egraphhopper-map-matching-core\u003c/artifactId\u003e\n    \u003cversion\u003e3.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Note\n\nNote that the edge and node IDs from GraphHopper will change for different PBF files,\nlike when updating the OSM data.\n\n### About\n\nThe map matching algorithm mainly follows the approach described in\n\n*Newson, Paul, and John Krumm. \"Hidden Markov map matching through noise and sparseness.\"\nProceedings of the 17th ACM SIGSPATIAL International Conference on Advances in Geographic\nInformation Systems. ACM, 2009.*\n\nThis algorithm works as follows. For each input GPS position, a number of\nmap matching candidates within a certain radius around the GPS position is computed.\nThe [Viterbi algorithm](https://en.wikipedia.org/wiki/Viterbi_algorithm) as provided by the\n[hmm-lib](https://github.com/bmwcarit/hmm-lib) is then used to compute the most likely sequence\nof map matching candidates. Thereby, the distances between GPS positions and map matching\ncandidates as well as the routing distances between consecutive map matching candidates are taken\ninto account. The GraphHopper routing engine is used to find candidates and to compute routing\ndistances.\n\nBefore GraphHopper 0.8, [this faster but more heuristic approach](https://karussell.wordpress.com/2014/07/28/digitalizing-gpx-points-or-how-to-track-vehicles-with-graphhopper/)\nwas used.\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphhopper%2Fmap-matching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphhopper%2Fmap-matching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphhopper%2Fmap-matching/lists"}