[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-developer
Subject:    Re: [Qgis-developer] iteration over raster
From:       Alexander Bruy <alexander.bruy () gmail ! com>
Date:       2011-02-24 16:29:02
Message-ID: 20110224182902.74fae2ad.alexander.bruy () gmail ! com
[Download RAW message or body]

AFAIK in QGIS API there are no methods for modifying raster cells.
To learn about querying raster values look at qgsmaptoolidentify.cpp file
in QGIS source tree.

If you want not only read pixel values but modify them, look at GDAL
and NumPy.

On Thu, 24 Feb 2011 16:36:01 +0100
Andruit@gmx.de wrote:

> Hello,
> I would like to write a qgis python plugin, which modifies cell values based on the \
> values of their surrounding neighbors. 
> But how can I iterate over a raster layer in order to read the value of each raster \
> cell (and its surrounding neighbors)? Is there any method querying raster cell \
> values 
> for i in range (1, numberofrows)
> for j in range (1, numberofcolumns)
> 
> value=???  #read cell value of cell[i j]
> 
> 
> Thank you very much in advance. 
> -- 
> GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
> gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Alexander Bruy
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic