[Gdal-dev] Read image file to Numpy, then output to image

Christopher Barker Chris.Barker at noaa.gov
Wed May 9 12:23:08 EDT 2007


Nate Jennings wrote:
>  >From other posts in other mail lists, I have been encouraged to look 
> at gdal for loading a multi-band image file into numpy, process it, then 
> write it out to an image format.

That may have been me ;-)


> img = gdal.gdal.Open('c:\\nate\\remote_sensing\\pyth_img_test.tif', 
> GA_ReadOnly)
> AttributeError: 'module' object has no attribute 'gdal'

you've got an extra "gdal" in there:

img = gdal.Open(.....

> if 
> I am having difficulty with loading libraries, having to change path 
> variables, etc, then this is too much for the novie Remote Sensing 
> student.

Once you've got it figured out, you should be able make it as simple as 
running some installers. Or maybe you can py2exe an app, and really make 
it easy.

   I am not into compiling my own libraries and will be pushing
> my programming limits with writing C++, binding python to c++ code, 
> etc.

I'm guessing you can do a lot of what you want without using C++.

I got a little lost in your explanation of what you really need, but 
we'll certainly help with how to accomplish specific tasks.

Try the above, and see how far you get.

-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