2024-09-27 21:27:53 发布
网友
我需要OSM提供的非洲大陆所有医院的档案。在这一点上,我只玩过从geofabrik等其他服务下载摘录,实际上我自己并没有下载任何数据。虽然我打算学习如何使用立交桥API,但我需要为这个项目快速周转。如何使用Python和OverpassAPI下载非洲医院的数据集
惊人的快速和短暂的速成课程:
下面的示例使用刚果仅仅是因为它比整个非洲都小,您可能还需要添加例如healthcare=*作为过滤器:
healthcare=*
$ wget https://download.geofabrik.de/africa/congo-democratic-republic-latest.osm.pbf (Progress...) $ osmosis read-pbf congo-democratic-republic-latest.osm.pbf log-progress tf accept-ways amenity=hospital,clinic,doctors,dentist used-node write-pbf congolese-hospitals.osm.pbf INFO: Osmosis Version 0.48.2 INFO: Preparing pipeline. INFO: Launching pipeline execution. INFO: Pipeline executing, waiting for completion. INFO: Processing Node 2096625632, 419655.26894621074 objects/second. INFO: Processing Node 6901615718, 515231.3074770092 objects/second. INFO: Processing Way 661735764, 877193.7612477505 objects/second. INFO: Processing completion steps. INFO: Completion steps took 13.833 seconds. INFO: Processing complete. INFO: Pipeline complete. INFO: Total execution time: 90156 milliseconds. $ ogr2ogr -f "ESRI Shapefile" congolese-hospitals ./congolese-hospitals.osm.pbf 0...10...20...30...40...50...60...70...80...90...100 - done. Warning 6: Normalized/laundered field name: 'admin_level' to 'admin_leve' ERROR 6: Geometry type of `Geometry Collection' not supported in shapefiles. Type can be overridden with a layer creation option of SHPT=POINT/ARC/POLYGON/MULTIPOINT/POINTZ/ARCZ/POLYGONZ/MULTIPOINTZ/MULTIPATCH. $
从警告和错误中可以看出,shapefile有点过时;如果地理包是一种选择
$ ogr2ogr -f GPKG congolese-hospitals.gpkg ./congolese-hospitals.osm.pbf 0...10...20...30...40...50...60...70...80...90...100 - done.
为了证明这一点,以下是在JOSM中浏览的部分结果:
惊人的快速和短暂的速成课程:
下面的示例使用刚果仅仅是因为它比整个非洲都小,您可能还需要添加例如
healthcare=*
作为过滤器:从警告和错误中可以看出,shapefile有点过时;如果地理包是一种选择
为了证明这一点,以下是在JOSM中浏览的部分结果:
相关问题 更多 >
编程相关推荐