Quantcast

KeyError with python grass.raster_info() in GRASS 7

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

KeyError with python grass.raster_info() in GRASS 7

Johannes Radinger
Hi,

when I try to get the max value of a raster map via python and grass.raster_info() in GRASS70 (revision 57523), I get following error:


grass.raster_info("test3")['max']
D1/1: grass.script.core.start_command(): r.info -gre map=test3
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/local/grass-7.0.svn/etc/python/grass/script/raster.py", line 80, in raster_info
    kv[k] = float_or_null(kv[k])
KeyError: 'min'

Is that easy to fix?

/Johannes

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: KeyError with python grass.raster_info() in GRASS 7

Johannes Radinger
oh sorry... problem solved! There was just the map "test3" not existing, so
the called r.info could not retrieve any information.
So there is no problem with raster_info, it was just my fault :(

/johannes


On Wed, Aug 28, 2013 at 12:30 PM, Johannes Radinger <[hidden email]> wrote:
Hi,

when I try to get the max value of a raster map via python and grass.raster_info() in GRASS70 (revision 57523), I get following error:


grass.raster_info("test3")['max']
D1/1: grass.script.core.start_command(): r.info -gre map=test3
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/local/grass-7.0.svn/etc/python/grass/script/raster.py", line 80, in raster_info
    kv[k] = float_or_null(kv[k])
KeyError: 'min'

Is that easy to fix?

/Johannes


_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Loading...