[gdal-dev] Problem with nodata values
Frank Warmerdam
warmerdam at pobox.com
Fri Jul 24 11:44:16 EDT 2009
Rainer M Krug wrote:
> Hi
>
> I have a geotiff and want to use gdalwarp to warp to it into a
> different projection.
> I do the following:
>
> gdalwarp -s_srs EPSG:32734 -t_srs '+proj=longlat +ellps=WGS84
> +no_defs' Outeniqua.tiff Outeniqua_wgs84.tiff
>
> The problem is, that in Outeniqua_wgs84.tiff, the nodata values from
> Outeniqua.tiff become translated into -9999. In addition, the areas
> new to Outeniqua_wgs84.tiff (due to the warping) become 1.
>
> Which options do I have to use to keep the nodata values and to make
> the values of the "new areas" also as nodata values?
Rainer,
I believe you want to pass the warp option INIT_DEST=-9999 to set all pixels
that do not come from the source file to -9999.
This is done with the -wo flag to gdalwarp.
eg.
gdalwarp -wo INIT_DEST=-9999 ...
The avalilable warp options are described in a web page available linked off
the gdalwarp utility page.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the gdal-dev
mailing list