Friday, 5 October 2018

postgis - How can I enable Shapefile GUI Loader in pgadmin3?


I have installed PostgreSQL 9.1 with PostGIS 1.5.3 on Ubuntu 11.10.


I also installed pgadmin3 1.14.0-beta1, following this instructions.



If I remember correctly, when I installed PostGIS on Windows pgadmin automagically came with Shapefile GUI Loader plugin already installed. On Ubuntu however, the plugin drop down menu is empty.


Instructions I found seems to be Windows specific.


Is there a way to install / enable it on Ubuntu?



Answer



If you want a painless install, you might want to start over and use the OpenGeo Suite version of PostGIS.


$sudo wget -qO- http://apt.opengeo.org/gpg.key | apt-key add -
$sudo echo "deb http://apt.opengeo.org/ubuntu lucid main" >> /etc/apt/sources.list
$sudo apt-get update
$apt-cache search opengeo
$sudo apt-get install opengeo-postgis


Or you could just install the shape loader instead of the whole postgis package.


$sudo apt-get install opengeo-postgis-shapeloader  

It would be installed in /usr/sbin you need to make a symbolic link to $$PGBINDIR ( which in this case is in /usr/bin )


$sudo ln -s /usr/sbin/shp2pgsql-gui /usr/bin/shp2pgsql-gui

Finally, in your plugins.ini file:



;

; pgShapeLoader (Linux):
;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME
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=No


As you're using pgadmin3 1.14.0, I think you need to place the plugins.ini under /usr/share/pgadmin3/plugins.d/. Lower versions put it under /usr/share/pgadmin3/


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...