[gdal-dev] basic raster math

Christopher Barker Chris.Barker at noaa.gov
Thu Feb 14 18:15:22 EST 2008


Greg Fiske wrote:
> placed in a namespace, it is now available as osgeo.gdal
> 
>   DeprecationWarning)

listen to that warning, and use:

from osgeo import gdal


>> >> gdal.Band.WriteAsArray(datadiff)
> 
> Traceback (most recent call last):
> 
>   File "<stdin>", line 1, in <module>
> 
> AttributeError: type object 'Band' has no attribute 'WriteAsArray'

gdal.Band is a class object -- you need to create a RasterBand object
(or use an existing one), and call WriteAsArray() on that. Sorry I can't
give you more help easily, so far I've needed read-only.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the gdal-dev mailing list