[PostGIS] #5881: CI failing on raster reprojection loader test
PostGIS
trac at osgeo.org
Tue Apr 15 10:15:00 PDT 2025
#5881: CI failing on raster reprojection loader test
----------------------+---------------------------
Reporter: pramsey | Owner: pramsey
Type: defect | Status: new
Priority: blocker | Milestone: PostGIS 3.5.3
Component: postgis | Version: master
Resolution: | Keywords:
----------------------+---------------------------
Comment (by pramsey):
The problem is introduced in this change to GDAL:
https://github.com/OSGeo/gdal/commit/757df93e6f42f021e801d818970e9f19215df35f
In particular, this block
{{{
if (psOptions->padfDstNoDataReal == nullptr)
{
CPLError(CE_Failure, CPLE_AppDefined,
"BAND_INIT was set to NO_DATA, but a NoData
value was "
"not defined.");
return CE_Failure;
}
}}}
The `rt_raster_gdal_warp()` function does a bunch of tap dancing around
checking if there are nodata values in the source raster, but then feeds
GDALWarp with `BAND_INIT=NO_DATA` as an option, so in the case of rasters
like the input to this test, that do not have NODATA set, GDAL fails.
Since the warp is frequently going to result in a new raster that has
empty corners and spaces, it makes sense to have a NODATA for the result.
And in fact `rt_raster_gdal_warp()` has a bunch of code to fill in a
NODATA place holder when there is not one, but that band-level machinery
only goes into action if at least one band has tripped a raster-level
`hasnodata` flag. The solution is to remove the check on `hasnodata`, as
it is just stopping what should be the correct answer, to infill a default
NODATA value whenever the input lacks one.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5881#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list