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:\Programs\osmosis\bin"
D:\Programs\osmosis\bin>osmosis --read-pbf "D:\DataWorkspace\data\beijing.osm.pbf" --write-xml "D:\DataWorkspace\data\beijing.osm"

第二步(osm數據過濾):beijing.osm --> beijing_cars.osm
cd "D:\DataWorkspace\data"
D:\DataWorkspace\data>osmfilter -h
D:\DataWorkspace\data>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插件方式


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM