[gdal-dev] gdalinfo on PostGIS rasters (GDAL 1.9)

Mathieu Basille basille at ase-research.org
Wed Nov 7 14:30:26 PST 2012


Dear GDAL developers,

I am currently working with a PostGIS data base, which contains a few 
rasters imported from .img raster files. The rasters work properly in 
PostGIS, and are displayed properly in QGIS. They are projected as WGS84 
(SRID 4326). They were imported using raster2pgsql, such as:

$ raster2pgsql -s 4326 -t 25x25 -I -C -M -F raster.img myschema.myraster | 
psql -h localhost -d mydb -U pguser

In PostGIS, the raster seem fine (they look OK in 'raster_columns'). 
However, if I try to access them using gdalinfo, I only get wrong 
information (i.e. empty raster, wrong coordinate system, etc.). For example:

$ gdalinfo "PG:dbname=mydb host=localhost user=pguser schema=myschema 
table=myraster"
Driver: PostGISRaster/PostGIS Raster driver
Files: none associated
Size is 0, 0
Coordinate System is:
PROJCS["ETRS89 / ETRS-TM33",
     GEOGCS["ETRS89",
         DATUM["European_Terrestrial_Reference_System_1989",
             SPHEROID["GRS 1980",6378137,298.257222101,
                 AUTHORITY["EPSG","7019"]],
             TOWGS84[0,0,0,0,0,0,0],
             AUTHORITY["EPSG","6258"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.0174532925199433,
             AUTHORITY["EPSG","9122"]],
         AUTHORITY["EPSG","4258"]],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",0],
     PARAMETER["central_meridian",15],
     PARAMETER["scale_factor",0.9996],
     PARAMETER["false_easting",500000],
     PARAMETER["false_northing",0],
     AUTHORITY["EPSG","3045"],
     AXIS["Northing",NORTH],
     AXIS["Easting",EAST]]
Origin = (0.000000000000000,0.000000000000000)
Pixel Size = (1.000000000000000,1.000000000000000)
Subdatasets:
... [list of all tiles]
Corner Coordinates:
Upper Left  (   0.0000000,   0.0000000) ( 10d30'40.52"E,  0d 0' 0.01"N)
Lower Left  (   0.0000000,   0.0000000) ( 10d30'40.52"E,  0d 0' 0.01"N)
Upper Right (   0.0000000,   0.0000000) ( 10d30'40.52"E,  0d 0' 0.01"N)
Lower Right (   0.0000000,   0.0000000) ( 10d30'40.52"E,  0d 0' 0.01"N)
Center      (   0.0000000,   0.0000000) ( 10d30'40.52"E,  0d 0' 0.01"N)

Detailed set-up:
* PostGIS 2.1.0SVN (r10597)
* GDAL 1.9.0, released 2011/12/29
* OS: Debian Wheezy

My ultimate goal is actually to import these rasters in R, but it seems 
that my first problem is between GDAL and PostGIS. Is there anything I'm 
doing wrong here?

Of course, I'd be happy to provide more information if required. Any advice 
would be greatly appreciated!

Mathieu Basille.


PS: I hope I'm using this list properly. Please let me know if you feel 
that the question should be addressed to postgis-devel instead.

-- 

~$ whoami
Mathieu Basille, PhD

~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille

~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard


More information about the gdal-dev mailing list