在pg admin III中没有postgis shapefile导入/导出管理器的选项

时间:2015-12-03 10:36:50

标签: postgresql ubuntu-14.04 postgis pgadmin

我没有PgAdmin III.Postgres版本9.4.4-3,postgis版本2.1.8中的PostGIS shapefile导入/导出管理器工具。我正在使用ubuntu 14.04。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

此过程仅在Ubuntu上进行测试:

  1. 使用文本编辑器(作为sudo用户)打开此文件:/usr/share/pgadmin3/plugins.d/plugins.ini

  2. 在文件末尾添加以下代码:

    ;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
    
  3. 保存并关闭文件,重新启动pgadmin

  4. 致谢:http://www.postgresonline.com/journal/archives/145-PgAdmin-III-Plug-in-Registration-PostGIS-Shapefile-and-DBF-Loader.html

答案 1 :(得分:0)

这就是我在Ubuntu 16.04上运行它的方法:

  1. 首先安装postgis,它是gui

    sudo apt-get install postgis postgis-gui

    一些较旧的教程会指导您安装opengeo-postgis2-shapeloader,但看来此软件包已弃用。 ̀̀ postgis-gui包含shp2pgsql-gui

  2. 现在按照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
    
  3. 这时,该项目出现在我的插件菜单中,但仍显示为灰色。我所做的是运行postgis-gui,单击“查看连接详细信息...”,并建立了与我的Postgres数据库的连接,并导入了shapefile进行测试

  4. 重新启动pgAdmin III etVoilà!

相关问题