我没有PgAdmin III.Postgres版本9.4.4-3,postgis版本2.1.8中的PostGIS shapefile导入/导出管理器工具。我正在使用ubuntu 14.04。我该如何解决这个问题?
答案 0 :(得分:2)
此过程仅在Ubuntu上进行测试:
使用文本编辑器(作为sudo用户)打开此文件:/usr/share/pgadmin3/plugins.d/plugins.ini
在文件末尾添加以下代码:
;PostGIS shp2pgsql-gui:
;;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -h "$$HOSTNAME" -p $$PORT -U "$$USERNAME" -d "$$DATABASE" -W "$$PASSWORD"
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR/shp2pgsql-gui
Platform=unix
ServerType=postgresql
Database=Yes
SetPassword=Yes
保存并关闭文件,重新启动pgadmin
答案 1 :(得分:0)
这就是我在Ubuntu 16.04上运行它的方法:
首先安装postgis,它是gui
sudo apt-get install postgis postgis-gui
一些较旧的教程会指导您安装opengeo-postgis2-shapeloader
,但看来此软件包已弃用。 ̀̀ postgis-gui
包含shp2pgsql-gui
。
现在按照Tommaso的说明编辑/usr/share/pgadmin3/plugins.d/plugins.ini
,方法是添加以下几行:
;
;PostGIS shp2pgsql-gui:
;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -h "$$HOSTNAME" -p $$PORT -U "$$USERNAME" -d "$$DATABASE" -W "$$PASSWORD"
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR/shp2pgsql-gui
Platform=unix
ServerType=postgresql
Database=Yes
SetPassword=Yes
这时,该项目出现在我的插件菜单中,但仍显示为灰色。我所做的是运行postgis-gui
,单击“查看连接详细信息...”,并建立了与我的Postgres数据库的连接,并导入了shapefile进行测试
重新启动pgAdmin III etVoilà!