[postgis-users] Raster and shapefile in POSTGIS

Mike Toews mwtoews at gmail.com
Wed Feb 15 01:00:26 PST 2012


On 15 February 2012 05:01, Zelio Fernandes <zelio.fern at gmail.com> wrote:
> *postgres at zelio-desktop:/usr/lib/postgresql/9.1/bin$ raster2pgsql -s 4236 -I
> -C -M /home/zelio/Desktop/Zelio/Zelio/L3-NE43A16-094-059-13oct08-BAND2.tif
> -F -t 30x30 public.demelevation | psql -d mydb
>
> raster2pgsql: command not found

The "command not found" error is a generic message saying it cannot
find the executable. You can either do this:
cd /usr/lib/postgresql/9.1/bin
./raster2pgsql

or use an absolute path:
/usr/lib/postgresql/9.1/bin/raster2pgsql

But I don't really recommend either of these first two, since you need
to reference the binaries at a specific path, which is a bit weird.

The easy solution is to create a symbolic link:
sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/raster2pgsql

or a slightly more complicated method, modify your $PATH environment
variable to include the postgres binaries. For Ubuntu, modify your
~/.profile file by adding to the end:

export PATH=$PATH:/usr/lib/postgresql/9.1/bin

then log out/log in, then try just typing "raster2pgsql".

-Mike



More information about the postgis-users mailing list