经典的利用轨迹生成地图的算法与数据集可寻找于:Mapconstruction by pfoser

Mapconstruction by pfoser数据集中,雅典数据集投影坐标系为(UTM, GGRS87),EPSG为2100,芝加哥数据集投影坐标系为(NAD83 / UTM zone 16N),EPSG为26916,柏林数据集投影坐标系为(ETRS89 / UTM zone 33N),EPSG为25833

此处笔者介绍AhmedKaragiorgouBiagioni的算法

1. Ahmed算法

此算法基于增量合并的方式,不断加入新的轨迹进行匹配,得到新的路网

代码可下载自:GitHub - pfoser/mapconstruction: Map Construction Algorithms

代码基于Java构建和shell脚本,最好是在安装有Java环境的Linux或者Mac平台上运行

切换到Ahmed目录下,编辑script_to_run.sh文件:

#To Compile:
CODE_PATH="MapConstruction/" #path to the MapConstruction folder.
cd $CODE_PATH
javac -d bin/ src/mapconstruction2/*.java #To Run:
INPUT_PATH="" #path to the folder that constains all input tracks
OUTPUT_PATH="" #path to the folder where output will be written
EPS=150.0 #epsilon in meters
HAS_ALTITUDE=false #if input file has altitude information
ALT_EPS=4.0 #minimum altitude difference in meters between two streets java -cp bin/ mapconstruction2.MapConstruction $INPUT_PATH $OUTPUT_PATH $EPS $HAS_ALTITUDE $ALT_EPS

设置好路径与参数,运行script_to_run.sh脚本,等待程序结束

2. Karagiorgou算法

此算法基于交叉口连接,找出道路中的交叉口进行连接,得到路网

代码可下载自:GitHub - pfoser/mapconstruction: Map Construction Algorithms

代码基于Matlab构建

代码运行步骤在代码的README.txt中已经详细说明

1) Add the two directories /source and /libraries to the current working path of the MATLAB
2) The source code is in the /source directory
3) The trajectory files should be in the form of: <x y timestamp>
4) You should firstly run the intersection_nodes_extraction.m file
This file loads trajectories and generates intersection nodes
5) You should then run the tracebundle.m file
This file loads trajectories and intersection nodes and generates road network vertices and edges.
It generates two files tracebundle_vertices.txt, tracebundle_edges.txt.

路网可视化

AhmedKaragiorgou算法生成的都是节点文件与边的文件,这里笔者提供一个转化为GeoJSON从而可视化的代码片段

vertices_dict = {}
with open('./data/resultvertices.txt','r') as vertices:
for line in vertices:
tmp = line.split(',')
vertices_dict[int(tmp[0])] = [float(tmp[1]),float(tmp[2][:-1])] edge_arr = []
with open('./data/resultedges.txt','r') as edges:
for line in edges:
tmp = line.split(',')
edge_arr.append([vertices_dict[int(tmp[1])],vertices_dict[int(tmp[2])]]) import os
import json def save_trajs(data, path, type_style):
res = {
"type": "FeatureCollection",
"features": []
}
for i, traj in enumerate(data):
t = {
"type": "Feature",
"geometry": {
"type": "LineString", "coordinates": traj
},
"properties": {
"id": i
}
} res["features"].append(t) if os.path.exists(path):
os.remove(path)
with open(path, "w") as f:
if type_style == "LineString":
json.dump(res, f) save_trajs(edge_arr, "./final_map.json", "LineString")

生成的GeoJSON文件可直接拖入QGIS软件进行可视化

3. Biagioni算法

此算法基于KDE,利用核密度估计图像生成路网

代码和数据下载地址:Bits - Software (uic.edu)

代码基于Python 2 构建

环境搭建过程可见:Map Inference in the Face of Noise and Disparity代码环境搭建 - 当时明月在曾照彩云归 - 博客园 (cnblogs.com)

最新文章

  1. 【团队项目选题】自选项目:桌游APP
  2. http协议中用于上传多个文件的 multipart 字段
  3. thinkphp 动态 级联
  4. php-fpm进程数优化
  5. js日期比较
  6. noi题库(noi.openjudge.cn) 1.9编程基础之顺序查找T01——T05
  7. [快速数论变换 NTT]
  8. 如何配置magento免运费商品方法
  9. LintCode-Implement Queue by Stacks
  10. 使用RMAN迁移文件系统数据库到ASM
  11. FlexBuilder远程调试WEB应用
  12. [UWP小白日记-11]在UWP中使用Entity Framework Core(Entity Framework 7)操作SQLite数据库(一)
  13. oracle数据库的数据类型
  14. pyqt5-按钮基类-QAbstractButton
  15. python 自动获取手机短信验证码
  16. WebService学习概念总结
  17. Linux 小知识翻译 - 「小型移动式PC」
  18. boostrapt的二级下拉菜单
  19. vue elment-ui 样式替换 input select
  20. IO多路复用(select)

热门文章

  1. 【每日一题】【上右下左模拟&amp;while循环体条件不满足时】54.螺旋矩阵-211110/220204
  2. 【Java】从头开始学新的编程语言
  3. SpringCloud微服务框架复习笔记
  4. 9、手写一个starter
  5. 【转载】EXCEL VBA 自定义排序的三种方法
  6. word取消保护
  7. [cocos2d-x]关于定时器
  8. Ubuntu 安装配置 Java 环境
  9. Python自动批量修改文件名称的方法
  10. 《爆肝整理》保姆级系列教程-玩转Charles抓包神器教程(5)-Charles如何设置捕获Https会话