Opened 3 years ago

Last modified 29 hours ago

#2901 new defect

raster gives confusing SRID message when GDAL_DATA path not set

Reported by: robe Owned by: dustymugs
Priority: high Milestone: PostGIS 2.2.7
Component: raster Version: trunk
Keywords: Cc:

Description

I was testing this on 2.1.2 and also 2.2.0 dev. I'm really puzzled where this SRS error is coming from:

I loaded the attached pic with

raster2pgsql -I -e -F -Y pics/*.jpg chicago_pics | psql -U postgres -d pgopen2014

and when I tried to do something like this

SELECT ST_Resize(rast,100,100)
  FROM chicago_pics 
  WHERE filename='Full_chicago_skyline.jpg';

I got this error:

NOTICE:  Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
CONTEXT:  SQL function "st_resize" statement 1


ERROR:  rt_util_gdal_convert_sr: Could not process the provided srs: EPSG:32731
CONTEXT:  SQL function "st_resize" statement 1
********** Error **********

ERROR: rt_util_gdal_convert_sr: Could not process the provided srs: EPSG:32731
SQL state: XX000
Context: SQL function "st_resize" statement 1

Where is it getting this SRS from. I checked the SRID of this picture

SELECT ST_SRID(rast)
  FROM chicago_pics 
  WHERE filename='Full_chicago_skyline.jpg'

and it returns 0

Attachments (1)

Full_chicago_skyline.jpg (160.2 KB) - added by robe 3 years ago.

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by robe

Attachment: Full_chicago_skyline.jpg added

comment:1 Changed 3 years ago by robe

Forgot to mention my versions

Output: 2.2

POSTGIS="2.2.0dev r12856" GEOS="3.5.0dev-CAPI-1.9.0 r3985" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.0, released 2014/04/16 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="0.12" RASTER

Output 2.1

POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER

It did occur to me that while I was testing on 2.2 and 2.1.2 I did load with raster2pgsql from 2.2 (and since my GDAL data folder seems out of place might be just an issue that affects me).

comment:2 Changed 3 years ago by robe

Milestone: PostGIS 2.1.4PostGIS 2.2.0
Version: 2.1.xtrunk

This might be a 2.2 bug or something wrong with my raster2pgsql 2.2. I just reloaded using the raster2pgsql from my 2.1.2 install and it doesn't exhibit this behavior. does the right thing.

I'll retest later with latest 2.2 raster2pgsql to be sure.

comment:3 Changed 3 years ago by robe

Summary: raster trying to use strange SRIDraster gives confusing SRID message when GDAL_DATA path not set

I isolated the issue to it happens when my GDAL_DATA path is not set right and postgis_full_version() gives -- GDAL_DATA not found

Couldn't figure out what was wrong with my path, so I retyped it and it worked. That solved the error.

I still think there is something wrong here though. Why does it even talk about a non-existent SRID. Almost like its confusing nodata value with an srid or something.

Tested with:

POSTGIS="2.2.0dev r12953" GEOS="3.5.0dev-CAPI-1.9.0 r3989" SFCGAL="1.0.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.0, released 2014/04/16" LIBXML="2.7.8" LIBJSON="0.12" TOPOLOGY RASTER

and if I get rid of my path so I get:

POSTGIS="2.2.0dev r12953" GEOS="3.5.0dev-CAPI-1.9.0 r3989" SFCGAL="1.0.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.0, released 2014/04/16 GDAL_DATA not found" LIBXML="2.7.8" LIBJSON="0.12" TOPOLOGY RASTER

Then this very confusing message comes up.

comment:4 Changed 2 years ago by dustymugs

Priority: mediumhigh

comment:5 Changed 2 years ago by robe

Milestone: PostGIS 2.2.0PostGIS 2.1.9

since this is both a postgis 2.2 and 2.1 issue moved to 2.1.9. to get it out of our 2.2 list.

comment:6 Changed 2 weeks ago by pramsey

Milestone: PostGIS 2.1.9PostGIS 2.2.6

comment:7 Changed 29 hours ago by pramsey

Milestone: PostGIS 2.2.6PostGIS 2.2.7
Note: See TracTickets for help on using tickets.