## Map Matching based on GraphHopper
[![Build Status](https://secure.travis-ci.org/graphhopper/map-matching.png?branch=master)](http://travis-ci.org/graphhopper/map-matching)
Map matching is the process to match a sequence of real world coordinates into a digital map.
Read more at [Wikipedia](https://en.wikipedia.org/wiki/Map_matching). It can be used for tracking vehicles' GPS information, important for further digital analysis. Or e.g. attaching turn instructions for any recorded GPX route.
Currently this project is under heavy development but produces already good results for various use cases. Let us know if not and create an issue!
See the demo in action (black is GPS track, green is matched result):
![map-matching-example](https://cloud.githubusercontent.com/assets/129644/14740686/188a181e-0891-11e6-820c-3bd0a975f8a5.png)
### License
Apache License 2.0
### Discussion
Discussion happens [here](https://discuss.graphhopper.com/c/graphhopper/map-matching).
### Installation and Usage
Java 8 and Maven >=3.3 are required. For the 'core' module Java 7 is sufficient.
Then you need to import the area you want to do map-matching on:
```bash
./map-matching.sh action=import datasource=./some-dir/osm-file.pbf vehicle=car
```
As an example you use `datasource=./map-data/leipzig_germany.osm.pbf` as road network base or any other pbf or xml from [here](http://download.geofabrik.de/).
The optional parameter `vehicle` defines the routing profile like `car`, `bike`, `motorcycle` or `foot`.
You can also provide a comma separated list. For all supported values see the variables in the [FlagEncoderFactory](https://github.com/graphhopper/graphhopper/blob/0.7/core/src/main/java/com/graphhopper/routing/util/FlagEncoderFactory.java) of GraphHopper.
If you have already imported a datasource with a specific profile, you need to remove the folder graph-cache in your map-matching root directory.
Now you can do these matches:
```bash
./map-matching.sh action=match gpx=./some-dir/*.gpx
```
As example use `gpx=./matching-core/src/test/resources/*.gpx` or one specific gpx file.
Possible arguments are:
```bash
instructions=de # default=, type=String, if an country-iso-code (like en or de) is specified turn instructions are included in the output, leave empty or default to avoid this
gps_accuracy=15 # default=15, type=int, unit=meter, the precision of the used device
```
This will produce gpx results similar named as the input files.
### UI and matching Service
Start via:
```bash
./map-matching.sh action=start-server
```
Access the simple UI via localhost:8989.
You can post GPX files and get back snapped results as GPX or as compatible GraphHopper JSON. An example curl request is:
```bash
curl -XPOST -H "Content-Type: application/gpx+xml" -d @/path/to/gpx/file.gpx "localhost:8989/match?vehicle=car&type=json"
```
#### Development tools
Determine the maximum bounds of one or more GPX file:
```bash
./map-matching.sh action=getbounds gpx=./track-data/.*gpx
```
#### Java usage
Or use this Java snippet:
```java
// import OpenStreetMap data
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile("./map-data/leipzig_germany.osm.pbf");
hopper.setGraphHopperLocation("./target/mapmatchingtest");
CarFlagEncoder encoder = new CarFlagEncoder();
hopper.setEncodingManager(new EncodingManager(encoder));
hopper.getCHFactoryDecorator().setEnabled(false);
hopper.importOrLoad();
// create MapMatching object, can and should be shared accross threads
GraphHopperStorage graph = hopper.getGraphHopperStorage();
LocationIndexMatch locationIndex = new LocationIndexMatch(graph,
(LocationIndexTree) hopper.getLocationIndex());
MapMatching mapMatching = new MapMatching(graph, locationIndex, encoder);
// do the actual matching, get the GPX entries from a file or via stream
List<GPXEntry> inputGPXEntries = new GPXFile().doImport("nice.gpx").getEntries();
MatchResult mr = mapMatching.doWork(inputGPXEntries);
// return GraphHopper edges with all associated GPX entries
List<EdgeMatch> matches = mr.getEdgeMatches();
// now do something with the edges like storing the edgeIds or doing fetchWayGeometry etc
matches.get(0).getEdgeState();
```
with this maven dependency:
```xml
<dependency>
<groupId>com.graphhopper</groupId>
<artifactId>map-matching</artifactId>
<!-- or 0.8-SNAPSHOT for the unstable -->
<version>0.7.0</version>
</dependency>
```
### Note
Note that the edge and node IDs from GraphHopper will change for different PBF files,
like when updating the OSM data.
### About
See [this project](https://github.com/bmwcarit/hmm-lib) from [Stefan](https://github.com/stefanholder) which is used in combination with the GraphHopper routing engine and is used as the algorithmic approach now. Before it was [this faster but more heuristic approach](https://karussell.wordpress.com/2014/07/28/digitalizing-gpx-points-or-how-to-track-vehicles-with-graphhopper/).
没有合适的资源?快使用搜索试试~ 我知道了~
map-matching-0.8.0.zip_Map matching_gps 地图匹配_graphhopper工具_map-m
共69个文件
java:28个
gpx:9个
xml:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 164 浏览量
2022-09-24
08:11:15
上传
评论
收藏 7.54MB ZIP 举报
温馨提示
一种基于openstreetmap和GPS轨迹的地图匹配算法--隐马尔科夫模型。
资源详情
资源评论
资源推荐
收起资源包目录
map-matching-0.8.0.zip (69个子文件)
map-matching-0.8.0
.travis.yml 172B
NOTICE 2KB
pom.xml 10KB
matching-core
pom.xml 3KB
src
test
resources
test2_no_millis.gpx 1KB
tour3-with-long-edge.gpx 2KB
issue-13.gpx 3KB
test2.gpx 1KB
test1.gpx 30KB
tour-with-loop.gpx 4KB
tour4-with-uturn.gpx 4KB
tour2-with-loop.gpx 4KB
java
com
graphhopper
matching
GPXFileTest.java 2KB
MapMatchingTest.java 15KB
util
HmmProbabilitiesTest.java 419B
LocationIndexMatchTest.java 4KB
MapMatching2Test.java 3KB
main
resources
log4j.xml 838B
java
com
graphhopper
matching
LocationIndexMatch.java 6KB
MapMatchingMain.java 9KB
EdgeMatch.java 2KB
GPXExtension.java 2KB
MatchResult.java 3KB
MapMatching.java 24KB
util
TimeStep.java 3KB
Distributions.java 2KB
HmmProbabilities.java 4KB
GPXFile.java 10KB
matching-web
pom.xml 5KB
src
test
resources
com
graphhopper
matching
http
tour2-with-loop.gpx 4KB
java
com
graphhopper
matching
http
BaseServletTester.java 5KB
MatchResultToJsonTest.java 5KB
MatchServletTest.java 3KB
main
webapp
css
images
marker-icon-2x.png 4KB
marker-icon.png 2KB
layers.png 1KB
layers-2x.png 3KB
marker-shadow.png 797B
loading.gif 2KB
style.css 175B
leaflet.css 9KB
index.html 2KB
js
leaflet.js 122KB
togeojson.js 17KB
demo.js 6KB
jquery-2.2.3.min.js 84KB
GHUtil.js 3KB
resources
log4j.xml 838B
java
com
graphhopper
matching
http
MatchServletModule.java 1KB
MatchServer.java 2KB
MatchServlet.java 9KB
MatchDefaultModule.java 2KB
MatchResultToJson.java 3KB
CONTRIBUTORS.md 458B
map-data
leipzig_germany.osm.pbf 7.35MB
map-issue13.osm.gz 6KB
map-matching.sh 1KB
.gitignore 204B
README.md 5KB
hmm-lib
NOTICE 764B
pom.xml 3KB
LICENSE 10KB
src
test
java
com
bmw
hmm
ViterbiAlgorithmTest.java 16KB
main
java
com
bmw
hmm
ViterbiAlgorithm.java 18KB
Transition.java 2KB
SequenceState.java 2KB
Utils.java 898B
README.md 3KB
LICENSE.txt 11KB
共 69 条
- 1
APei
- 粉丝: 64
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Python 程序语言设计模式思路-结构型模式:组合模式:将对象组合成树形结构
- 毕业设计基于python矩阵分解的推荐算法研究源码+详细文档+全部数据资料 高分项目.zip
- 基于网络的入侵检测系统源码+数据集+详细文档(高分毕业设计).zip
- 微信小程序源码 旅行故事分享 - 面包旅行App界面设计与文本展示资源下载
- 微信小程序源码 创意互动游戏 - 你画我猜App下载
- 摸底考试_学生版20230305.py
- 课程设计基于FPGA数字钟课程设计源码+课设报告(95分以上).zip
- 基于Java的企业家申报系统设计源码
- Cesium案例,集成各种模型,推演,各种Cesium效果
- 基于Python的Struts2全漏洞扫描利用工具设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1