实现将arcgis支持的.gdb中的数据和qgis支持的.gpkg中的数据导入到Postgres数据库中
第一步:安装PostgreSQL
安装好后自带pgAdmin管理工具 相当于是一个图形管理工具
第二步:安装PostGIS拓展
注意一定是架构 public 进行查询界面 命令检查
CREATE EXTENSION postgis; # 启用postgis插件
SELECT postgis_full_version(); # 用来检查是否安装了postgis
第三步:安装GDAL
通过OSGeo4W安装GDAL通过https://trac.osgeo.org/osgeo4w/
,下载OSGeo4W
通过OSGeo4w安装GDAL 实际要使用下面
ogr2ogr -f "PostgreSQL" PG:"host=localhost port=5433 user=postgres password=Qq123456 dbname=postgis_gis" D:\lv220914.gdb -overwrite -progress --config PG_USE_COPY YES -lco LAUNDER=NO
重点注意细节
我们首次安装需要选择第一个,Express Desktop Install
才会有GDAL 界面选择
GDAL默认是不安装gdb的驱动的。这次我们选择Advanced Install,一直到下图位置:
再次注意 一定要使用
OSGeo4w Shell,然后输入:ogrinfo --formats
其他途径就管可以查看但是依然驱动不对 ERROR 1: Unable to find driver `PostgreSQL'
就是属于 GDAL 未安装成功
最终实现通过
ogr2ogr -f "PostgreSQL" PG:"host=localhost port=5433 user=postgres password=Qq123456 dbname=postgis_gis" D:\lv220914.gdb -overwrite -progress --config PG_USE_COPY YES -lco LAUNDER=NO
- PostgreSQL ogr 命令 PostGIS ogr2ogrpostgresql ogr命令postgis ogr2ogr postgresql postgis ubuntu postgresql centos7 postgis centos postgresql postgis ubuntu 18.04 postgresql插件postgis数据库 timescaledb postgresql插件postgis postgresql postgis pgsql postgresql postgis centos7 centos 集群postgresql pgrouting postgis