[GRASS-dev] casting row buffer in memory

Glynn Clements glynn at gclements.plus.com
Thu Oct 9 05:46:50 PDT 2014

Pietro wrote:

> > Looking at the code for grass.pygrass.raster.RasterRow.open(), the
> > overall structure is rather flawed. It primarily considers whether the
> > map already exists, then secondarily considers the mode (r/w).
> >
> > It should be the other way around.
> Right. Thank you for your code review!
> I will try to fix this on the next days.

Having thought about it some more, I'd suggest giving serious
consideration to splitting the RasterRow class into separate classes
for input and output.

The two are sufficiently different that I'm not entirely sure that a
common base class wouldn't be empty. Most of the libraster functions
which accept an open map descriptor ("fd") either only work on input
(old) maps or only work on output (new) maps.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list