[GRASS-dev] G_put_raster_row and OpenMP

Glynn Clements glynn at gclements.plus.com
Mon Dec 3 11:46:47 EST 2007


Yann wrote:

> > I don't know if it's "major", but one thing to bear in mind is that
> > the map must have been opened with G_open_cell_new_random() in order
> > to be able to use that function.
> 
> OK, this is noted, it means I have to create a function to open a floating 
> point cell: G_open_fp_cell_new_random(). 
> 
> In opencell.c, G_open_cell_new_random() returns a call to 
> G__open_raster_new(name, type of Open). Where is this function located 
> please,

It's also in opencell.c, line 605 in the CVS HEAD version.

> and does it need modification in this case? 

Maybe. You may also need to change the code in put_row.c; there's no
guarantee that it allows for the combination of random access and
floating-point.

> > This has several consequences: the map is stored uncompressed, it
> > cannot contain nulls, and it cannot be floating-point (essentially,
> > when FP and null values were added in 5.x, the random-access case
> > wasn't upgraded).
> >
> > Neither of these factors would be particularly hard to change.
> 
> Could you direct me a bit on changing those? 

Mostly you just need to check that put_row.c allows for all of the
cases.

Regarding the buffering of null values, change NULL_ROWS_INMEM (in
lib/gis/G.h) to 1.

One thing to bear in mind with compressed output is that overwriting a
row won't remove the data for the old row from the file.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list