[postgis-users] rasters not read

0 views
Skip to first unread message

Paolo Cavallini

unread,
Jan 4, 2011, 9:07:50 AM1/4/11
to PostGIS Users Discussion
Hi all.
I updated PostGIS from trunk yesterday, and I now get errors reading
rasters from newly created db:

gdal_translate -of GTiff "PG: dbname=test3 host=fox user=test
password=*** port=5432 schema=public
table=spain_images" /home/paolo/Desktop/spain.tif
ERROR 1: Can't get georeference coordinates from database
ord=test port=5432 schema=public
table=spain_images" /home/paolo/Scrivania/prov.ERROR 1: Sorry, but
couldn't create the structure to read the raster on memory,
aborting.
GDALOpen failed - 1
Sorry, but couldn't create the structure to read the raster
on memory, aborting.

Any hint?
All the best.
--
http://www.faunalia.it/pc

_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Jorge Arévalo

unread,
Jan 4, 2011, 9:38:23 AM1/4/11
to PostGIS Users Discussion

Hi Paolo,

This is a problem with GDAL driver, not a PostGIS one. I need to know 2 things:

- What version of GDAL are you using? (gdalinfo --version)
- Did you specify the srid when you loaded the raster files? Using -s
option in raster2pgsql.py (or gdal2wktraster.py, in case of and old
version of PostGIS Raster)

Best regards,

--
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge....@deimos-space.com
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g

Paolo Cavallini

unread,
Jan 4, 2011, 9:56:57 AM1/4/11
to PostGIS Users Discussion
Il giorno mar, 04/01/2011 alle 15.38 +0100, Jorge Arévalo ha scritto:
> This is a problem with GDAL driver, not a PostGIS one.

Strange, it is working on a db created about a week ago, not on the more
recent ones. Same gdal.

> - What version of GDAL are you using? (gdalinfo --version)

1.7.2 from debian experimental.

> - Did you specify the srid when you loaded the raster files? Using -s
> option in raster2pgsql.py

Yes; I tried with 2 different EPSG, no difference.

Thanks a lot.

Jorge Arévalo

unread,
Jan 4, 2011, 10:41:23 AM1/4/11
to PostGIS Users Discussion
On Tue, Jan 4, 2011 at 3:56 PM, Paolo Cavallini <cava...@faunalia.it> wrote:
> Il giorno mar, 04/01/2011 alle 15.38 +0100, Jorge Arévalo ha scritto:
>> This is a problem with GDAL driver, not a PostGIS one.
>
> Strange, it is working on a db created about a week ago, not on the more
> recent ones. Same gdal.
>

Could you told me the PostGIS Raster versions used to create both dbs?
If you can't, at least the commands used to create the db that is
causing you problems


>> - What version of GDAL are you using? (gdalinfo --version)
>
> 1.7.2 from debian experimental.
>

This version of GDAL uses an old version of the GDAL driver. I made
some improvements a couple of months ago. Using the last GDAL version
from trunk may help. But let's see what's happening with the db,
before doing this


>> - Did you specify the srid when you loaded the raster files? Using -s
>> option in raster2pgsql.py
>
> Yes; I tried with 2 different EPSG, no difference.
>

The SRID for Spain TIFF files (if you're using these
http://dl.dropbox.com/u/6599273/srtm_spain.zip) is 4326.


> Thanks a lot.

Thanks to you for providing me feedback :-). I'd like to help users as
much as I can. And to learn, of course.

Best regards,

Paolo Cavallini

unread,
Jan 4, 2011, 10:57:38 AM1/4/11
to PostGIS Users Discussion
Il giorno mar, 04/01/2011 alle 16.41 +0100, Jorge Arévalo ha scritto:

> Could you told me the PostGIS Raster versions used to create both dbs?

I compile from svn. The two versions are from 23 december (working) and
today (not working)

> If you can't, at least the commands used to create the db that is
> causing you problems

I create the db with the usual sequence:

createdb yourdatabase
psql -d yourdatabase -f postgis/postgis.sql
psql -d yourdatabase -f doc/postgis_comments.sql
psql -d yourdatabase -f spatial_ref_sys.sql
psql -d yourdatabase -f raster/rt_pg/rtpostgis.sql
psql -d yourdatabase -f doc/raster_comments.sql

then

python raster2pgsql.py -r w001001.adf -t dtm_rt -l 1 -k 64x64 -o
dtm_rt.sql -s 3003 -I -M

(same with other rasters).

Thanks a lot.

--
http://www.faunalia.it/pc

_______________________________________________

Jorge Arévalo

unread,
Jan 4, 2011, 11:10:13 AM1/4/11
to PostGIS Users Discussion

So, correct me if I'm wrong...

You compiled PostGIS from trunk and did the same sequence

createdb yourdatabase
psql -d yourdatabase -f postgis/postgis.sql
psql -d yourdatabase -f doc/postgis_comments.sql
psql -d yourdatabase -f spatial_ref_sys.sql
psql -d yourdatabase -f raster/rt_pg/rtpostgis.sql
psql -d yourdatabase -f doc/raster_comments.sql

python raster2pgsql.py -r w001001.adf -t dtm_rt -l 1 -k 64x64 -o


dtm_rt.sql -s 3003 -I -M

(I suppose after that you did psql -d yourdatabase -f drm_rt.sql)

You did it on December 23rd and today. And with the same version of
GDAL, you tried to transform the PostGIS Raster in a TIFF file. With
the db created on 23rd it worked, but with the db created today, it
doesn't.

Could you send me the original files you loaded in PostGIS?

Best regards,

Paolo Cavallini

unread,
Jan 4, 2011, 11:30:41 AM1/4/11
to PostGIS Users Discussion
Il giorno mar, 04/01/2011 alle 17.10 +0100, Jorge Arévalo ha scritto:

> So, correct me if I'm wrong...

> (I suppose after that you did psql -d yourdatabase -f drm_rt.sql)

Correct.

> You did it on December 23rd and today. And with the same version of
> GDAL, you tried to transform the PostGIS Raster in a TIFF file. With
> the db created on 23rd it worked, but with the db created today, it
> doesn't.
>
> Could you send me the original files you loaded in PostGIS?

I tried with several files, including the sample ones (utm.tif).

All the best.

Jorge Arévalo

unread,
Jan 4, 2011, 12:26:43 PM1/4/11
to PostGIS Users Discussion

Ok. I'll check the Spaing GeoTIFF files with GDAL 1.7.2 to reproduce
your problem. Could you send me one of your raster files?

I've created a new GDAL ticket, to manage this problem:
http://trac.osgeo.org/gdal/ticket/3892

Best regards,

Paolo Cavallini

unread,
Jan 4, 2011, 12:43:22 PM1/4/11
to PostGIS Users Discussion
Il giorno mar, 04/01/2011 alle 18.26 +0100, Jorge Arévalo ha scritto:
> Ok. I'll check the Spaing GeoTIFF files with GDAL 1.7.2 to reproduce
> your problem. Could you send me one of your raster files?
You can use this:
http://dl.dropbox.com/u/6599273/utm.tif

> I've created a new GDAL ticket, to manage this problem:
> http://trac.osgeo.org/gdal/ticket/3892

Thanks a lot.

Jorge Arévalo

unread,
Jan 5, 2011, 4:10:20 PM1/5/11
to PostGIS Users Discussion

Thanks to you, again.

Seems to work for me. Could you please make a test with the last GDAL
version from trunk? Or at least with this one

http://download.osgeo.org/gdal/gdal-1.8.0beta2.tar.gz

Reply all
Reply to author
Forward
0 new messages