[gdal-dev] nodata value assigned via script
Klokan Petr Přidal
klokan at klokan.cz
Sat Oct 18 03:40:10 EDT 2008
Hi Roger,
Matt answered the question already...
The official documentation for handling masks and nodata values in GDAL is:
http://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask
and the complete python interface is tested in this file:
http://trac.osgeo.org/gdal/browser/trunk/autotest/gcore/mask.py
Klokan
On Sat, Oct 18, 2008 at 12:57 AM, Matt Wilkie <matt.wilkie at gov.yk.ca> wrote:
> Wow, a python question I actually know the answer too! :)
>
> From python you can use "band.SetNoDataValue( float(null_value) )". For this
> in context see this tiny utility:
> http://maphew.googlecode.com/svn/trunk/gis/gdal_extras/bin/gdalsetnull.py
>
> And the doc on this function:
> http://www.gdal.org/classGDALRasterBand.html#c6f081d253dee55c372e54cfdd8f05a6
>
> cheers,
>
> 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/
> --------------------------------------------
>
>
> Roger André wrote:
>>
>> Hi,
>>
>> I'm getting raster data written by different people who can't seem to use
>> the same nodata values. I'm reading the data files via the Python API to
>> GDAL, and doing various calculations on the data values, then writing new
>> rasters with the results of my calculations. Is there a "nodata" value that
>> I can assign to a pixel that the gdal utilities will recognize as such later
>> on? All my other values are 32-bit floating point values, so I'm not sure
>> what value to assign.
>>
>> Thanks.
>>
>> Roger
>> --
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
More information about the gdal-dev
mailing list