Opened 9 years ago

Closed 8 years ago

#4416 closed defect (fixed)

PostGIS raster driver using obsolete column names and constructs

Reported by: robe Owned by: jorgearevalo
Priority: normal Milestone: 1.9.1
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: postgis_raster, postgisraster, wktraster
Cc: jorgearevalo, dzwarg

Description (last modified by robe)

I guess its probably too late to get these fixes in for 1.9.0 since you are at rc1 already.

Couple of issues with PostGIS raster driver detailed in http://trac.osgeo.org/postgis/ticket/1422

postgisraserrasterband.cpp is using obsolete column names.

Line 118:

   osCommand.Printf("select o_table_name, overview_factor, o_column, "
                "o_table_schema from raster_overviews where r_table_schema = "
                "'%s' and r_table_name = '%s' and r_column = '%s'",
                poDS->pszSchema, poDS->pszTable, poDS->pszColumn);

should be:

   osCommand.Printf("select o_table_name, overview_factor, o_raster_column, "
                "o_table_schema from raster_overviews where r_table_schema = "
                "'%s' and r_table_name = '%s' and r_raster_column = '%s'",
                poDS->pszSchema, poDS->pszTable, poDS->pszColumn);

New raster meta views are documented in: http://www.postgis.org/documentation/manual-svn/using_raster.xml.html#RT_Raster_Overviews

and http://www.postgis.org/documentation/manual-svn/using_raster.xml.html#RT_Raster_Columns

Also the use of construct:

st_setsrid(st_makebox2d(st_point(%f, %f), st_point(%f,"
                "%f)),%d)

shoudl be replaced with:

st_makeenvelope(%f, %f, %f,%f,%d)

As documented here: http://www.postgis.org/documentation/manual-svn/ST_MakeEnvelope.html

Since we are slowly phasing out the use of box2d

Change History (10)

comment:1 Changed 9 years ago by robe

Description: modified (diff)
Summary: PostGIS raster driverPostGIS raster driver using obsolete column names and constructs

comment:2 Changed 9 years ago by warmerdam

Component: defaultGDAL_Raster
Keywords: postgis raster added

Regina,

Yes, I think this is too late for 1.9.0 unless the RC is cancelled. But there is no reason not to have it fixed in 1.9 branch as soon as is practical. I'm not really in a position to test changes though so I'm hesitant to apply them.

comment:3 Changed 9 years ago by Even Rouault

Cc: jorgearevalo added

comment:4 Changed 9 years ago by pracine

Owner: changed from warmerdam to jorgearevalo

comment:5 Changed 9 years ago by pracine

Keywords: postgis_raster added; postgis raster removed

comment:6 Changed 9 years ago by dzwarg

Cc: dzwarg added

comment:7 Changed 9 years ago by jorgearevalo

Status: newassigned

comment:8 Changed 9 years ago by jorgearevalo

Milestone: 1.9.1

comment:9 Changed 9 years ago by Mateusz Łoskot

Keywords: postgisraster wktraster added

comment:10 Changed 8 years ago by jorgearevalo

Resolution: fixed
Status: assignedclosed

Fixed in r24815 (Probably was fixed in a previous commit, but I'm sure this include it)

Note: See TracTickets for help on using tickets.