[Gdal-dev] assign nodata to existing tif?

Matt Wilkie matt.wilkie at gov.yk.ca
Fri Nov 25 17:02:37 EST 2005


Hi Frank,

> You can use the -a_nodata switch to gdal_translate to treat
> a particular value as nodata.  However, this doesn't normally
> affect the nearest neighbour resampling done by gdal_translate.
> Perhaps you mean for the CDED writer, which is pretty special
> in this regard?

No this is not cded. I'm mosaicking together shaded relief images (256 
colour gray scale arcinfo grids) using gdal_merge and then jpeg 
compressing the mosaick. When I do that I get edge resampling. Using 
-a_nodata has no effect.

   gdal_merge -o no-comp.tif -n 255 {list of grids}
   gdal_translate no-comp.tif jpeg.tif -co "compress=jpeg" -a_nodata 255

To test I also tried translating a single source grid, with and without 
-a_nodata, and replicated the edge effect. Screen shot attached.


-- 
matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdal-jpeg-edge-resampling.png
Type: image/png
Size: 7673 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051125/24961b78/gdal-jpeg-edge-resampling.png


More information about the Gdal-dev mailing list