[Qgis-user] Problems with raster layer in geopackage

Nicolas Cadieux njacadieux.gitlab at gmail.com
Sun Sep 25 18:58:15 PDT 2022


Hi,

Look's like the layer manager in QGIS has got files names, layer names 
and aliases all mixed up for rasters in gpkg. When renaming the raster 
in the layer manager, one only changes the layer alias so the original 
file name and layer name remain the unchanged, thus, you can't copy the 
raster over itself as only file name and layer names are used.  I guess 
you can only delete the raster using the database tool as opening it in 
the file browser will automatically lock the file for reading, which 
makes sense.

This looks like a good bug report...

Nicolas

On 2022-09-23 11:54 p.m., David Strip wrote:
> On 9/23/2022 9:59 AM, Nicolas Cadieux wrote:
>> Am afraid to notice we have not solve your initial issue about naming 
>> the rasters… :( When you look at the geopackage with the database 
>> tool,  is the layer with the raster identified with the correct name? 
>>  What happens to the raster name if you save 2 rasters in the 
>> geopackage?  This could be an issue with the naming conventions of 
>> the layer manager instead of an issue with the file format… 
> When I look at the gpkg with DB Browser for SQLite, the table 
> associated with the raster layer has the correct name, but when I open 
> the gpkg in the Qgis browser, it has the same name as the gpkg.
> What's odder is that I then added that raster to a different gpkg (one 
> that I created for the testing in the last email), and it keeps the 
> name, which is to say the name of the gpkg. I added that raster to a 
> blank map and renamed it. I then dragged it into the test gpkg, and 
> now it has the new name.  So now I try to copy the renamed layer into 
> the original gpkg where is has the wrong name and get an error that I 
> can't copy the raster over itself (I used the original name). Even 
> with a different name I can't add it to the gpkg, as it appears to be 
> recognized as the original file. After backing up the gpkg, I thought 
> I'd delete the misnamed file and restore it from the project I added 
> it to. But you can't delete a raster from a gpkg if it's open in a 
> project. I'm baffled.
>
-- 
Nicolas Cadieux
https://gitlab.com/njacadieux



More information about the Qgis-user mailing list