使用osm2pgsql将osm导入postgis中
使用osm2pgsql将osm导入postgis中
1、将需导入的osm文件放到osm2pgsql文件夹中
2、新建数据库,如osm
3、配置好扩展,如下图
其中plpgsql一般会自动添加好,主要是添加postgis和hstore这两个扩展,具体做法:
(1)、右键扩展,点击新建扩展
(2)、在名称下拉框中选择所需的扩展即可
4、在cmd窗口下,先转到osm2pgsql所在的文件夹目录下,再使用下列命令即可
osm2pgsql -d osm -U postgres -P 5432 -S “F:\PostgreSQL\osm2pgsql\osm2pgsql\x64\default.style” map.osm
标红的参数意义:
osm ————————————- 数据库的名称
postgres ——————————- postgresql的用户名
5432 ———————————– postgresql的端口号
F:\PostgreSQL\osm2pgsql\osm2pgsql\x64\default.style
—————————————— default.style的路径
map.osm ——————————– 需导入的osm全名
转载自:https://blog.csdn.net/qq_36061233/article/details/84886132