Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
1  
there's a --with-gui configure flag if you install PostGIS from source, but I've never tried this so I can't say if it works –  Mike T Oct 25 '11 at 19:53
    
@MikeToews: Thanks. I noticed it in the docs as well now. Well worth remembering for the future but I'm still hoping to enable it in already installed stack. –  radek Oct 26 '11 at 21:51
1  
I have the same problem. I was able to install the opengeo-postgis-shapeloader thru synaptic package but I can't see it in pgAdmin3. I'm using Xubuntu 10.04 –  user5626 Jan 25 '12 at 5:59
    
I couldn't get the --with-gui flag to work on ubuntu. You could download the OpenGeo package opengeo.org/technology/suite/download and use the gui that comes with it, but it's not ideal. –  djq Feb 11 '12 at 1:24
1  
@jessie Please check if the plugins.ini contents in my answer works for you. –  R.K. Feb 11 '12 at 1:27
add comment

6 Answers 6

up vote 7 down vote accepted

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/

share|improve this answer
    
Thanks for that. Tried your second method and updated my plugins.ini file - unfortunately it didn't change anything :/ –  radek Feb 9 '12 at 0:45
    
Hmmm... I took that plugins.ini file from the OpenGeo version. Maybe you have to set the parameters to match your current configuration? I just checked the package listings at pkgs.org. Could you verify if shp2pgsql is in your PGBINDIR? –  R.K. Feb 9 '12 at 3:01
    
How exactly could i verify that? –  radek Feb 9 '12 at 9:54
    
Could you run find and check if shp2pgsql-gui exists in your filesystem? –  R.K. Feb 10 '12 at 23:51
    
Changed my answer. Please check if it works this time. I'll test it on my box, too as soon as I get home. –  R.K. Feb 11 '12 at 1:25
show 10 more comments

This response may be late,but i had the same trouble and i found the solution. Try this command on your terminal :

$sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql /usr/bin/shp2pgsql
share|improve this answer
    
Thanks, unfortunately didn't help in my case :/ –  radek Nov 8 '11 at 18:06
add comment

I can't believe I'm having the same issue in 2014 with 12.04.

Neither the GUI nor command-line shapeloader install using the opengeo-suite.

I simply followed the noob-friendly directions on this website: http://www.staygeo.com/2013/05/enabling-postgis-shapefile-and-dbf.html, which parallel the instructions by RK almost 2 years ago.

"Install opengeo-postgis2-shapeloader using this command at terminal:

sudo apt-get install opengeo-postgis2-shapeloader

It gets installed in /usr/lib/postgresql/9.2/bin as shp2pgsql-gui. Now create a symbolic link for the same in /usr/bin directory. Prior to this you may want to check if the postgresql version you have is 9.2.

sudo ln -s /usr/lib/postgresql/9.2/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui 

Now it's the time to edit plugins.d file. Use the following command to open the file for editing:

gksudo gedit /usr/share/pgadmin3/plugins.d/plugins.ini

Paste the following contents at the end of the 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

Note: You may have to set the environment variable PGBINDIR on your machine. To check if the environment variable is already set type this on your terminal:

echo $PGBINDIR

If an empty line appears as a result, it indicates that environment variable is not set. You will have to set it to /usr/bin (the location where the symbolic link for shapefile loader resides). For that use this command:

PGBINDIR=/usr/bin

Once the above steps are done invoke pgAdmin III to see the 'PostGIS Shapefile and DBF Loader' listed under plugins."

No copyright intended (it's well-written so I didn't paraphrase :).

share|improve this answer
add comment

You could try the instructions here. It's definitely a separate executable on Fedora. Also, have you tried:

sudo apt-get install shp2pgsql-gui?

share|improve this answer
    
I thought about sudo as well. Unfortunately response is: Unable to locate package shp2pgsql-gui. Thanks for other pointer - will have a look. –  radek Oct 26 '11 at 21:50
add comment

Step1. Create folder name: plugin.d in folder PgAminIII Ex:

C:\Program Files\OpenGeo\OpenGeo Suite\pgsql\9.1\pgAdmin III\plugins.d

Step2. Create files config for app you need in new plugins folder

EX: postgis.shp2pgsql-gui

 psql

detai file: postgis.shp2pgsql-gui:

; ; PostGIS shp2pgsql-gui (Windows): ;

Title=PostGIS Shapefile and DBF loader 2.0
Command="$$PGBINDIR\shp2pgsql-gui.exe" -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.exe
Platform=windows
ServerType=postgresql
Database=Yes
SetPassword=Yes
share|improve this answer
    
Thanks, but the question was meant to be Ubuntu/Linux specific.. –  radek Sep 27 '13 at 8:27
add comment

If its already installed in Ubuntu, I just typed shp2pgsql-gui into terminal and it ran!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.