[gdal-dev] gdaladdo, overviews and NODATA

Armin Burger armin.burger at gmx.net
Wed Feb 22 14:36:52 EST 2012



On 21/02/2012 22:36, Frank Warmerdam wrote:
> On Tue, Feb 21, 2012 at 1:17 PM, Armin Burger<armin.burger at gmx.net>  wrote:
>> Then I tried to set the NODATA value to 0 using Gdal-Python, and afterwards
>> they had
>>
>> Band 1 Block=3000x1 Type=Byte, ColorInterp=Red
>>   NoData Value=0
>> Band 2 Block=3000x1 Type=Byte, ColorInterp=Green
>>   NoData Value=0
>> Band 3 Block=3000x1 Type=Byte, ColorInterp=Blue
>>   NoData Value=0
>>
>> But the result was the same, when using "-r average" a 1-2 pixel area of the
>> original NODATA values along the border to the DATA areas seem to have got
>> pixels with higher values than 0 (at least in Mapserver they cannot any more
>> be "hidden" with OFFSITE). Is there a simple way to write out the overviews
>> to separate Tiff files so that I can check them directly?
>
> Armin,
>
> You can use the gdal/apps/dumpoverviews app to write out overviews.  It may
> not be built and installed by default.   If you confirm the overviews are built
> wrong then please file a ticket, and provide with it a small sample file with
> which you encounter the problem.
>
> Best regards,

Frank

I checked the overviews after dumping them into Tiff files. I could not 
see anything strange with them along the border DATA-NODATA. The 
supposed NODATA pixels all had value 0 in all bands. So the problem 
seems a bit related how Mapserver handles the files. Strangely enough 
that the problem does not appear when the OV are created with nearest 
resampling. Being somehow more related to Mapserver I filed a ticket there

http://trac.osgeo.org/mapserver/ticket/4210

But the ticket owner are already you anyway ;-)

I could not upload a small test image due to file size restrictions (the 
zip has 3 MB). Should I send the file to you or someone else via mail?

I discovered an additional strange effect when using the layer 
processing parameter
   PROCESSING "RESAMPLE=BILINEAR"

which will create partially colored effects along the DATA-NODATA line. 
All of this happens just in the case that this line is not exactly 
horizontal or vertical but oblique due to image warping. I will create 
another ticket for this. So far it seems that I can use no "smoothing" 
via resampling, neither with overviews nor with the layer definition 
without having some "border effects".

Thanks

Armin



More information about the gdal-dev mailing list