将shape文件导入到postgis

先生成sql文件
E:\Program Files\PostgreSQL\9.5\bin>shp2pgsql -s “4326” -W “LATIN1” F:/work/213/
data/city.shp city > F:/work/213/data/city.sql

执行sql文件
E:\Program Files\PostgreSQL\9.5\bin>psql -U postgres -f F:/work/213/data/city.sq
l postgis -P root

直接导入到数据库
E:\Program Files\PostgreSQL\9.5\bin>shp2pgsql -s “4326” -W “LATIN1”  F:/work/213
/data/city.shp public.city | psql -U postgres -w -d postgis

向已有表中追加数据
E:\Program Files\PostgreSQL\9.5\bin>shp2pgsql -s “4326” -a -W “LATIN1”  F:/work/
213/data/city.shp public.city | psql -U postgres -w -d postgis

转载自:https://blog.csdn.net/fan504/article/details/54707625

You may also like...