[GRASS-dev] distributed computing: block access in raster lib

Yann Chemin ychemin at gmail.com
Mon Apr 13 10:01:43 PDT 2015


Hi,

I am looking into distributed processing of raster data in GRASS,

I found this in i.smap/read_block.c

Would that be a good idea to include something similar into the raster lib API?

#include <stdlib.h>

#include <grass/raster.h>
#include <grass/imagery.h>
#include <grass/glocale.h>

#include "bouman.h"
#include "region.h"

int read_block(DCELL *** img,	/* img[band][row[col] */
	       struct Region *region, struct files *files)
{
    int band, row, col;

    for (band = 0; band < files->nbands; band++) {
	for (row = region->ymin; row < region->ymax; row++) {
	    Rast_get_d_row(files->band_fd[band], files->cellbuf, row);
	    for (col = region->xmin; col < region->xmax; col++)
		img[band][row][col] = files->cellbuf[col];
	}
    }

    return 0;
}

Cheers,
Yann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150413/52930192/attachment.html>


More information about the grass-dev mailing list