[gdal-dev] Map algebra

Ari Jolma ari.jolma at gmail.com
Tue Apr 12 04:06:30 PDT 2016


12.04.2016, 12:47, alex kirjoitti:
>
> I wasn't trying to suggest to do away with the block level stuff, I can see how it makes your code efficient (and more efficient than the row-by-row iteration that I am using). However, I did notice that for many functions this part of the code is generic and does not rely on the template type.

ok, I'll look into that. It would be good if the size of the binaries 
could be smaller.

>
>> Also the pixel level operation should be as fast as possible and thus a
>> function call in itself would cause overhead - however, using inline
>> function might help.
> Ok, if pixel-level functions are off the table then I give up. To me one of the major aims of a Map Algebra library would be to make it easy to apply pixel-level functions on raster data (along with other aims to support focal, zonal and global operations).

I have the "cell callback" method, which is intended for user specified 
arbitrary functions on each pixel. For example in the test.cpp there is 
a callback, which sets the cell value to be the distance from 0,0:

int callback(gma_cell_t *cell) {
     // set cell value = distance from 0,0
     double x = cell->x();
     double y = cell->y();
     double d = sqrt(x*x+y*y);
     cell->set_value(d);
     return 2;
}

Ari

>
>> Ari
>>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list