On Wed, Oct 8, 2014 at 11:24 AM, Glynn Clements <[email protected]> wrote: > > Pietro wrote: > >> So even if I'm explicitly casting the result in the scaler function >> with dtype(...), the result is not properly casted, do you have an >> idea on how could I solve this problem? > > This is a bug in pygrass: > > $ r.info -g foo | fgrep datatype > datatype=CELL > $ python > Python 2.7.7 (default, Sep 26 2014, 00:18:15) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > > from grass.pygrass.raster import RasterRow > > out = RasterRow('foo', mode='w', mtype='DCELL', overwrite=True) > > out.mtype > u'CELL' > > If a map with the chosen name already exists, its type is used in > place of the one specified.
Thank you to find out this bug, I didn't noticed it. > 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. All the best. Pietro _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
