[ZOO-Discuss] python gdal numpy array question
niels hoffmann
nielslcr at gmail.com
Fri Dec 10 12:56:59 PST 2010
zootribe,
I've got a question about some raster processing using python.
The code below works when I run it standalone, but not if I run it as a
zoo-service.
Does anybody have a clue why not?
<==========>
driver=gdal.GetDriverByName('GTiff')
driver.Register()
ds=gdal.Open(filename, GA_ReadOnly)
cols=ds.RasterXSize
rows=ds.RasterYSize
rain_factor=0.85
r2arr=ds.GetRasterBand(1).ReadAsArray(0,0,cols, rows).astype(float)
r2rainfactor=dot(rain_factor,r2arr)
outputs["Result"]["value"]=str(r2rainfactor[100,100])
<=========>
TRACE : 'NotImplementedType' object is unsubscriptable
TRACE : <type 'exceptions.TypeError'>
Unable to run your python process properly
So I'm trying to do a numpy scalar*array multiplication with the dot
operator, this seems to be working standalone, but not in CGI?
Cheers, Niels
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20101210/c206ff0a/attachment.html>
More information about the Zoo-discuss
mailing list