[GIS] raster2pgsql does nothing

gdalpostgispostgis-2.0raster2pgsql

I try to load rasters through raster2pgsql. I try to call it through pgAdmin command line, but when I call any raster2pgsql command (even raster2pgsql -G), it does nothing, I just get another line to write more commands. No output, no time doing something. Non-gdal psql commands work as expected. \raster2pgsql leads to "invalid command" error. I am new to the command line and psql, so I'm stuck here.

I have PostgreSQL 9.3.4, PostGIS 2.1.3 and pgAdmin III 1.18.1 on WIndows XP 32 bit. I made sure that raster2pgsql.exe is in its place in bin folder, but I don't know of other ways to validate whether it is installed properly.

Best Answer

You first mistake is trying to call it via pgAdmin command line. Just call it from dos screen.

What you could do is create a batch file like

load_data.bat

Then put lines like folliowing in there and then run the bat file

SET PATH="%PATH%;c:\Program files\PostgresSQL\9.3\bin"
SET PGPORT=5432
SET PGHOST=localhost
SET PGUSER=postgres
SET PGPASSWORD=whatever
raster2pgsql -I -e -F -C -Y -s 26986 -t 500x500  dems/*.tif noaa | psql -d yourdb
pause

Putting a pause will allow you to see what happens

Related Question