[GRASS-dev] problem using pygrass
Javier Martínez-López
javi.martinez.lopez at gmail.com
Thu Feb 27 08:45:09 PST 2014
Hello,
I have a couple of problems when using pygrass for analyzing raster
maps stored in GRASS with the numpy library:
- First: I cannot close the maps, since I always get the following error:
>>> import numpy
>>> import grass.pygrass as pygrass
>>> demx = pygrass.raster.RasterNumpy('dem')
>>> demx.open('r')
>>> dem2 = demx.flatten()
>>> len(dem2)
43860
>>> demx.close()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/grass-7.0.y14/grass-7.0.svn/etc/python/grass/pygrass/raster/__init__.py",
line 654, in close
self._write()
File "/usr/local/grass-7.0.y14/grass-7.0.svn/etc/python/grass/pygrass/raster/__init__.py",
line 597, in _write
self.tofile(self.filename)
ValueError: 43860 requested and 0 written
- Second: when I change the region (with g.region) and read again some
maps, it uses the same extent as before and I always get a "core dump
error". I print the region in the script and it has in deed changed
but I always get maps from the same size as before...
Could anybody help?
Thank you very much and best regards,
Javier
More information about the grass-dev
mailing list