Opened 3 years ago

Last modified 4 months ago

#2914 new defect

[raster] ST_Rescale: Could not create GDAL transformation object for output dataset creation

Reported by: strk Owned by: dustymugs
Priority: blocker Milestone: PostGIS Fund Me
Component: raster Version: 2.1.x
Keywords: Cc: EvenR

Description

Obtained with this query:

with data as ( 
   SELECT ST_AddBand(
          ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 4326),
          1, '8BUI', 0, 0
        ) r 
 ), 
 meta as ( 
   SELECT st_metadata(st_rescale(r,2.0,-2.0)) m from data 
 ) select (m).* from meta;

Note that using a SRID=0 fixes the issue (see #2911)

Change History (10)

comment:1 Changed 3 years ago by strk

Milestone: PostGIS 2.1.4
Priority: mediumblocker

comment:2 Changed 3 years ago by strk

Figured out, the problem is that the ST_Rescale call ends up calling _st_gdalwarp passing NULL srs for both source and destination when they are the same. The core then does not enter the special case of default georeference, but doesn't have an SRS to initialize GDAL with either.

comment:3 Changed 3 years ago by strk

Cc: EvenR added

Worse than that, by passing not-null SRS even when source and destination have the same one only serves the purpose of failing later, as the "default geotransform" is not appreciated by GDAL (or so it looks). So we're back to the point that default geotransform need special handling, no matter reprojection being involved.

comment:4 Changed 3 years ago by robe

Component: postgisraster
Owner: changed from pramsey to dustymugs

comment:5 Changed 3 years ago by strk

The workarounds for identity matrix handling could be removed by fixing GDAL upstream, see http://lists.osgeo.org/pipermail/gdal-dev/2014-September/039980.html

comment:6 Changed 3 years ago by strk

I confirm that this fix to GDAL fixes the PostGIS run too: https://github.com/OSGeo/gdal/pull/40

comment:7 Changed 3 years ago by strk

Summary: ST_Rescale: Could not create GDAL transformation object for output dataset creation[raster] ST_Rescale: Could not create GDAL transformation object for output dataset creation

comment:8 Changed 3 years ago by robe

Milestone: PostGIS 2.1.4PostGIS 2.2.0

So is this still a PostGIS issue or has it been fixed in GDAL? In which case we should mark this as PostGIS GDAL?

Anyrate pushing to 2.2. Push back to whereever it goes

comment:9 Changed 3 years ago by dustymugs

Milestone: PostGIS 2.2.0PostGIS Future

comment:10 Changed 4 months ago by robe

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.