[GRASS-user] Pygrass reading raster issue

Lorenzo Bottaccioli lorenzo.bottaccioli at gmail.com
Mon Mar 14 06:55:10 PDT 2016


Region is Ok!

2016-03-14 14:45 GMT+01:00 Moritz Lennert <mlennert at club.worldonline.be>:

> Le Mon, 14 Mar 2016 13:45:42 +0100,
> Lorenzo Bottaccioli <lorenzo.bottaccioli at gmail.com> a écrit :
>
> > Hi all,
> >
> > I'm tring to read a raster map from my grassData.
> >
> > I'm using this code
> >
> >     import os
> >     import grass.script.setup as gsetup
> >     from grass.pygrass import raster
> >
> >     gisbase = os.environ['GISBASE']
> >     gisdbase = os.path.abspath("/home/myuser/grassData")
> >     location = 'mylocation'
> >     mapset = 'mymapset'
> >     gsetup.init(gisbase, gisdbase, location, mapset)
> >
> >     elev=raster.RasterRow('elevation')
> >     elev.open()
> >     for row in elev:
> >         print row
> >
> > But I get all values with nan, where is the error?
> >
> > If I do `elev.info()` I get this result
> >
> >     elevation@
> >     rows: 4502
> >     cols: 5554
> >     north: 45.0743663458 south: 45.0500262069 nsres:5.40651685671e-06
> >     east:  7.67457811722 west: 7.6445503225 ewres:5.40651687473e-06
> >     range: 233.050003052, 310.049987793
> >     proj: 3
> >
>
>
> Check your computational region settings.
>
> Moritz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160314/6e66e65d/attachment.html>


More information about the grass-user mailing list