Translate Raster: Empty metadata despite asking 'copyMetadata' : True

Issue #1346 invalid
Agustin Lobo created an issue

After using Translate Raster to clip a raster layer, the resulting geotif has empty metadata despite having set 'copyMetadata' : True

Version 3.10.0.20220401T124144.develop c7d679b

QGIS version: 3.24.2-Tisler
QGIS code revision: 13c1a02865
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.2.2
GEOS version: 3.9.0-CAPI-1.16.2
PROJ version: Rel. 7.2.1, January 1st, 2021
PDAL version: 2.2.0 (git-version: Release)
Algorithm started at: 2022-05-02T20:18:31
Algorithm 'Translate raster layer' starting…
Input parameters:
{ 'bandList' : [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234], 'copyMetadata' : True, 'copyStyle' : True, 'creationProfile' : 'GTiff INTERLEAVE=BAND', 'dataType' : 5, 'excludeBadBands' : True, 'extent' : '-6.632194990,-6.522305681,37.665109210,37.740793857 [EPSG:4326]', 'grid' : None, 'noData' : None, 'offset' : None, 'outputTranslatedRaster' : '/media/alobo/LaCieNTFS2T/Ignacio2019/RioTinto/PRISMA/v2/RT1_PRS_20210625_SR.tif', 'raster' : '/media/alobo/LaCieNTFS2T/Ignacio2019/RioTinto/PRISMA/v2/PRS_L2D_STD_20210625111917_20210625111921_0001_SR.tif', 'resampleAlg' : 0, 'scale' : None, 'sourceColumns' : [nan,nan], 'sourceNoData' : None, 'sourceRows' : [nan,nan], 'spectralBandList' : None, 'spectralSubset' : None, 'unsetNoData' : False, 'unsetSourceNoData' : False, 'workingType' : None, 'writeEnviHeader' : True }

Translate raster 331x288x234 -of GTiff -co INTERLEAVE=BAND /media/alobo/LaCieNTFS2T/Ignacio2019/RioTinto/PRISMA/v2/RT1_PRS_20210625_SR.tif
Execution completed in 2.06 seconds
Execution completed in 2.17 seconds
Results:
{'outputTranslatedRaster': '/media/alobo/LaCieNTFS2T/Ignacio2019/RioTinto/PRISMA/v2/RT1_PRS_20210625_SR.tif'}

Loading resulting layers
Algorithm 'Translate raster layer' finished

Comments (13)

  1. Agustin Lobo reporter

    The input raster comes from importing a PRISMA L2D product and it is fine (with all metadata and can be displayed with Color Space Explorer etc.

    Then I try translate to discard bad bands and make a subscene, and the resulting tif does not have the metadata and cannot be correctly displayed as wavelength info, band names and gain are not present in Raster Properties/GDAL Metadata (even with a .tif.hdr file)

    https://www.dropbox.com/s/8z51i9ft7i783bh/RT1_PRS_20210625_SR.tif?dl=0

    https://www.dropbox.com/s/miz455q09dhh86y/RT1_PRS_20210625_SR.tif.hdr?dl=0

  2. Andreas Rabe

    Hi Agus, I can’t reproduce this with the enmap_berlin.bsq dataset. Looks all fine.

    Maybe is is only related to the PRISMA product. I’ll check this.

  3. Andreas Rabe

    Hmm, PRISMA also works fine.

    Are you using the translate algorithm from the EnMAP-Box?

    Maybe you used the GDAL algo “Translate (convert format)“, which won’t copy metadata.

    Please check again.

  4. Andreas Rabe

    Algorithm 'Translate raster layer' starting…

    Ah ok, you used the correct algorithm.

    Please provide a minimal step-by-step example to reproduce the problem. Can you reproduce the problem with the enmap_berlin.bsq dataset?

  5. Agustin Lobo reporter

    Hmm, PRISMA also works fine.

    In that case, send me the resulting small subscene, without bad bands (equivalent to the one I made RT1_PRS_20210625_SR.tif) and I will verify it.

    Have you verified that RT1_PRS_20210625_SR.tif has the problems I mention?

    Please provide a minimal step-by-step example to reproduce the problem

    is not everything in the log?

    Can you reproduce the problem with the enmap_berlin.bsq dataset?

    Please send me the extent that you have used for the subscene in this image and the bands you have defined as bad.

  6. Agustin Lobo reporter

    It turns out that I cannot reproduce this error myself now. I think this is related to the creation profile, or perhaps to a previous operation, I have to investigate it further. I do not think I have changed anything on my system but have to check as well.

  7. Agustin Lobo reporter

    Cannot reproduce it, cannot find the way I got the raster with no metadata. I would close it by now and I will keep an eye on this.

  8. Log in to comment