0

i'm trying to import raster to postgis using this command ;

raster2pgsql -I -C -s 4326 -t 100x100 -M "C:\DATA TRIAL APOLLO\mosaik129_130.ecw" -F public.mosaik129_130 | psql -d apollo_db

but then error message :

ERROR: unable to read raster file: C:\DATA TRIAL APOLLO\mosaik129_130.ecw

and it's requiring a password, even on my windows account, i'm not setting any password.

does anyone have solutions?

6
  • Try to use -w switch(no password), may be together with -U (user). Commented Jun 7, 2018 at 4:30
  • still doesn't work. i input : raster2pgsql -I -C -s 4326 -t 100x100 -M "C:\DATA TRIAL APOLLO\mosaik129_130.ecw" -F public.mosaik129_130 | psql -d apollo_db -w switch. and it goes : ERROR: unable to read raster file: C:\DATA TRIAL APOLLO\mosaik129_130.ecw psql: fe_sendauth: no password supplied Commented Jun 7, 2018 at 6:25
  • It's requiring you to supply a password for the database, not windows. If you have ever used anything else to connect to the database then you probably know what information to supply. Regarding "unable to read raster file" though, are you sure that your gdal supports .ecw files ? Commented Jun 7, 2018 at 7:50
  • i also try using other raster format (.tif). but the result is still the same ERROR: unable to read raster file. i also already input the postgresql database password, it's still error like this : psql: FATAL: password authentication failed for user "amal" i already check pgpass.conf, input the password stated there, and still goes failed. and for windows account, i'm not setting any password. Commented Jun 7, 2018 at 8:05
  • Please Edit the question in response to requests for clarification. It's not fair to those who would answer to need to mine the comments for critical information. Commented Jun 7, 2018 at 10:35

2 Answers 2

1

You have two problem. But The main problem is ECW format that you need to install GDAL Plugin for it. Please have a look here

0

It is asking for the password to your PostgreSQL database for user amal.

You need to supply it like:

raster2pgsql -I -C -s 4326 -t 100x100 -M "C:\DATA TRIAL APOLLO\mosaik129_130.ecw" -F public.mosaik129_130 | PGPASSWORD=yourpass psql -d apollo_db

PGPASSWORD=yourpass added

If your database doesn't have a user called amal, you need to either supply a username as well in psql part of the query or create one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.