將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
發佈了26 篇原創文章 · 獲贊 4 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章