提取OSM行政边界的方法

  • 各国行政边界划分表
    https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative
boundary=administrative
admin_level=3 to 10
  • Overpass
    原文链接
rel[admin_level=(level number)]
   [type=boundary]
   [boundary=administrative]
   [ (specific tag to identify the country, see below) ];
out geom;

--With the specific tags to identify the country (with XX=iso2 country code):
admin_level=2 > ["ISO3166-1"~"^XX"]
admin_level=3 > ["is_in:country"="XX"]
admin_level=4 > ["ISO3166-2"~"^XX"]
  • 知道relation的id的,有一个手动提取的步骤
    https://peteris.rocks/blog/openstreetmap-administrative-boundaries-in-geojson/

  • OSM Admin Boundaries Map

调用方法
URL:

https://wambachers-osm.website/boundaries/exportBoundaries?cliVersion=1.0&cliKey=52d97a3b-3fc1-44cd-bd9a-e8c1c9468bab&exportFormat=json&exportLayout=levels&exportAreas=land&union=false&selected=270056,913011,912940,913069,553303,153314,911844,286342,286937,2128285,912998,199073,407492,913110,913106,913073,161349,913012,913109,198590,912942,1867188,913101,153269,913100,913006,913067,913105,913068,912999,153292,153310,913094,553302

selected后边的数字就是relation的id号

使用命令 curl -f -o file.zip --url 'URL' 将会下载上述链接的内容,存储为文件
Don't forget the ' before and after the url!

你可能感兴趣的:(提取OSM行政边界的方法)