osm与shp之间转换工具

开始准备的步骤
Osmosis工具
https://wiki.openstreetmap.org/wiki/Osmosis
Osmfilter工具
https://wiki.openstreetmap.org/wiki/Osmfilter
osm2shp在线工具
https://geoconverter.hsr.ch/
.osm.pbf下载地址
http://download.openstreetmap.fr/extracts/asia/china/

osm2pgsql下载地址

https://osm2pgsql.org/doc/install.html

https://osm2pgsql.org/doc/manual.html

第一步(.osm.pbf 转 .osm):beijing.osm.pbf --> beijing.osm
cd "D:Programsosmosisin"
D:Programsosmosisin>osmosis --read-pbf "D:DataWorkspacedataeijing.osm.pbf" --write-xml "D:DataWorkspacedataeijing.osm"

第二步(osm数据过滤):beijing.osm --> beijing_cars.osm
cd "D:DataWorkspacedata"
D:DataWorkspacedata>osmfilter -h
D:DataWorkspacedata>osmfilter beijing.osm --keep="highway=living_street =motorway =motorway_junction =motorway_link =primary =primary_link =residential =road =secondary =secondary_link =service =tertiary =tertiary_link =trunk =trunk_link =unclassified" --drop="access=no =private" >beijing_cars.osm

第三步(.osm 转 .shp):beijing_cars.osm --> shp
OSM格式数据转换shp工具(可以指定转换坐标系)
网页版GeoConverter工具,网址链接:https://geoconverter.hsr.ch/
打开GeoConverter主页面后,将下载的OSM数据一般是矢量文件(Vector File),所以选择第三个数据转换方式,点击“Vector File to…”链接按钮
点击第一行“Select file*”链接,选择上一步下载的数据(xxx.osm,Interpreter数据均可),
点击第二行“Select export format*”链接,在弹出的下拉列表中选择需要的数据格式,它提供了多种导出格式
.ban
.dxf
.csv
.gdb
.shp
.gmt
.......

其他工具 beijing_cars.osm --> shp 工具
osm转shp在线转换工具https://mygeodata.cloud/converter/osm-to-shp

第四步(shp道路分割与打断):道路打断ArcGIS
shp --> shp(ArcGIS分割线段)
ArcGIS

第五步(.shp转.osm,并检查):josm数据检查
shp --> osm JOSM软件安装opendata插件,JOSM软件 “图像” 菜单---“影像首选项”---“插件”图标
JOSM+opendata插件: 采用JOSM软件加opendata插件方式

个人学习记录
原文地址:https://www.cnblogs.com/jeshy/p/14673364.html