Opened 10 years ago

Closed 10 years ago

#5522 closed defect (fixed)

postgisraster driver fails to fully honour the "column" uri component

Reported by: strk Owned by: warmerdam
Priority: normal Milestone: 1.11.1
Component: default Version: 1.10.1
Severity: normal Keywords: postgisraster
Cc:

Description

Using this command:

gdalinfo 'PG: dbname=strk host=localhost user=strk port=5493 mode=2 schema=public table=areas column=r'

Results in this postgresql query:

select st_bandpixeltype(rast, band), st_bandnodatavalue(rast, band) is null, st_bandnodatavalue(rast, band) from (select r, generate_series(1, st_numbands(r)) band from (select rast from public.areas limit 1) bar) foo

The "rast" reference in the query is bogus, the "r" one is correct.

Change History (6)

comment:1 by strk, 10 years ago

Found, it's full of hard-coded "rast" field names. Will produce a patch ASAP.

comment:2 by strk, 10 years ago

Patch ready: https://github.com/OSGeo/gdal/pull/33 I hadn't add a testcase as I'm still not sure how to even run them (happy to learn)

comment:3 by Even Rouault, 10 years ago

Could you rebase on 1.11 or trunk ? It is unlikely we'll produce a 1.10.2 and there have been significant changes in the driver between 1.10 and 1.11

As far as the tests are concerned, there's http://svn.osgeo.org/gdal/trunk/autotest/gdrivers/postgisraster.py. There's a preliminary setup to do : see comment at the beginning of the script.

comment:4 by strk, 10 years ago

I'll port to trunk, but the existing test fails for me, see http://strk.keybit.net/tmp/postgisraster.log

Are them supposed to work ? This is with postgis trunk:

POSTGIS="2.2.0dev r12618" GEOS="3.5.0dev-CAPI-1.9.0 r3978" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 2.0.0dev, released 2014/04/16" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER

comment:5 by Even Rouault, 10 years ago

Hum, now that you mention it, I kind of remember that a few of them failed. Actually in your log, there's just one failed test in the summary (some error messages might be OK since some tests test error conditions)

comment:6 by strk, 10 years ago

Milestone: 1.10.21.11.1
Resolution: fixed
Status: newclosed

It looks like the bug is already fixed in both 1.11 and trunk branches. The test failures would better be moved to their own ticket.

Note: See TracTickets for help on using tickets.