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

List:       qgis-developer
Subject:    Re: [Qgis-developer] raster algebra plugin II - the return!
From:       "Barry Rowlingson" <b.rowlingson () lancaster ! ac ! uk>
Date:       2008-11-29 19:46:06
Message-ID: d8ad40b50811291146t28b7ed69jaa9a8907e32371b () mail ! gmail ! com
[Download RAW message or body]

2008/11/29 Martin Dobias <wonder.sk@gmail.com>:

> You would define some processing functions like:
>
> def rasterMax(r1, r2):
>  return (... something ...)

 There's hardly any need to do that - numpy.max(r1,r2) does exactly
that, and can take more than two parameters.

> Can you give me an example of more complex requirements?

 In my original idea the plugin would have one line for entering an
expression, and some way of assigning raster layer bands to variables
in the expression (R1, R2 etc). The 'more complex requirements' would
be if you wanted to do more than one thing, or use an intermediate
calculation more than once. Like:

 x1 = sin(R1)
 x2 = x1 * x1
 x3 = sqrt(x1)
 saveRaster(x2)
 saveRaster(x3)

> In fact
> allowing some raster algebra stuff into python could be done quite
> easily - a matter of adding some variables to globals dictionary, so
> users could run directly from console: RasterBand(...) *
> RasterBand(...)

 Yeah, I'd add some helper functions to my plugin that you could just
import into the console (or any python code).

 The RasterBand class could just be a superclass of numpy array that
also stores the raster band coordinates... One thing I'd do in the
plugin would be to make sure all rasters have the same grid system.

Barry
_______________________________________________
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