1.下载OSM地图数据。
使用下列指令可以下载整个地球的数据。
wget -c http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
如果你想下载个别国家或部分区域的数据,点击http://download.geofabrik.de/。可以下载不同国家不同区域的数据。这里我下载了中国的数据:
wget -c http://download.geofabrik.de/asia/china-latest.osm.pbf
现在从osm用户中退出。
exit
2.下载osm2pgsql
为了导入地图数据,我们需要安装osm2pgsql,这个插件能将OSM数据存储在postgreSQL数据库中。