[gdal-dev] Errors writing GeoTIFF with NBITS=1

Schmitz, Uwe uwe.schmitz at bezreg-koeln.nrw.de
Wed Jun 19 00:54:00 PDT 2019


Even,

thanks for investigating in this!

Maybe I should have mentioned: gdal was configure'd  --without-pam 
during build. I think that's why GDAL_PAM_ENABLED is
"NO" by default in my environment.
Yes, may be these errors are not critical, but in my
context (scripting) such errors cause the termination
of the process...

Anyway, thank you very much for the quick patch!

Best wishes
Uwe

>-----Ursprüngliche Nachricht-----
>Von: Even Rouault [mailto:even.rouault at spatialys.com]
>Gesendet: Dienstag, 18. Juni 2019 17:02
>An: gdal-dev at lists.osgeo.org
>Cc: Schmitz, Uwe
>Betreff: Re: [gdal-dev] Errors writing GeoTIFF with NBITS=1
>
>On mardi 18 juin 2019 14:17:16 CEST Schmitz, Uwe wrote:
>> Hi Folks,
>>
>> with gdal 2.4.0 I get errors doing the following:
>>
>> gdal_translate \
>>    -co COMPRESS=PACKBITS \
>>    -co NBITS=1 \
>>    -co PHOTOMETRIC=MINISWHITE \
>>    -co PROFILE=GeoTIFF \
>>    -a_srs epsg:25832 \
>>    src.tif \
>>    dst.tif<CR>
>> Input file size is 4000, 4000
>> ERROR 6: dst.tif, band 1: SetOffset() not supported on this raster band.
>> ERROR 6: dst.tif, band 1: SetScale() not supported on this raster band.
>> ERROR 6: dst.tif, band 1: SetUnitType() not supported on this raster band.
>> 0...10...20...30...40...50...60...70...80...90...100 - done.
>>
>> src.tif is also GeoTIFF with NBITS=1, COMPRESS=PACKBITS etc.
>> but dst.tif seems to be the problem.
>> A search showed me that I can prevent the errors by setting:
>> export GDAL_PAM_ENABLED=YES
>>
>> Is this intended?
>
>I can only reproduce the error mess[Schmitz, Uwe] "ages you get by explictly setting
>GDAL_PAM_ENABLED=NO (GDAL_PAM_ENABLED=YES being the default)
>Explicitly disabling PAM will lead to such, generally non critical, warnings/
>errors when PAM features are needed. That said, for that particular case, I've
>just pushed a fix in the GTiff driver to avoid the error messages to be
>emitted, but you could encounter them in a number of other places.
>
>Even
>
>--
>Spatialys - Geospatial professional services
>http://www.spatialys.com


More information about the gdal-dev mailing list