Bug report #17103
QgsRasterFileWriter fails to export raster into a geopackage
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Even Rouault | ||
Category: | Rasters | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 25002 |
Description
Destination tables are created but they are empty.
See comments in https://github.com/qgis/QGIS/pull/5057#issuecomment-323992656
And a failing test case in: https://github.com/boundlessgeo/QGIS/commit/e4a81d277658d19557b76115870ab3ed9164f1cc#diff-9a0fc019f23587c8baa0bdb3ba89fbad
Associated revisions
[GDAL provider] in create(), use newly create dataset handle to instanciate the provider (fix #17103)
Previously we created an empty file, close it and re-opened it immediately in open mode.
However for GeoPackage, if you create for example a 1 band or 3 band dataset, upon reopening
you get a 4 band RGBA dataset, due to the fact that GeoPackage doesn't explicitly store the
number of bands. Thus the 4th band (alpha) was never written by the QgsRasterFileWriter logic.
Merge pull request #5580 from rouault/fix_QgsRasterFileWriter_geopackage
[GDAL provider] in create(), use newly create dataset handle to instanciate the provider (fix #17103)
History
#1 Updated by Even Rouault over 7 years ago
- Assignee set to Even Rouault
#2 Updated by Even Rouault about 7 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|c3e15f522837d1f0bdd47c1ffc1b0ab3cba5e869.