Dear users
I am new with Grass. I am trying to use the r.hazard.flood extension but I get the following error:
Traceback (most recent call last):
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 145, in
sys.exit(main())
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 78, in main
resolution = (float(dict_region[‘nsres’]) + float(dict_region[‘ewres’]))/2
ValueError: invalid literal for float(): 0:00:00.17656
Any idea of what can be wrong? my dem file (named fmosaic) is type raster, FCELL, 5099 rows 7647 columns, resolution: 0:00:00.17656
I thougth it was probably a problem with the dem resolution (5 m) but I tried with another DEM with different resolution and get the same error warning.
Dear users
I am new with Grass. I am trying to use the r.hazard.flood extension but I get the following error:
Traceback (most recent call last):
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 145, in
sys.exit(main())
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 78, in main
resolution = (float(dict_region[‘nsres’]) + float(dict_region[‘ewres’]))/2
ValueError: invalid literal for float(): 0:00:00.17656
Any idea of what can be wrong? my dem file (named fmosaic) is type raster, FCELL, 5099 rows 7647 columns, resolution: 0:00:00.17656
I thougth it was probably a problem with the dem resolution (5 m) but I tried with another DEM with different resolution and get the same error warning.
pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo <diregola@gmail.com> napsal:
as far as I remember, it worked only in projected coordinate system.
1) should be mentioned in manual at least
Traceback (most recent call last):
File "/home/lara/.grass7/addons/scripts/r.hazard.flood", line 145, in <module>
sys.exit(main())
File "/home/lara/.grass7/addons/scripts/r.hazard.flood", line 78, in main
resolution = (float(dict_region['nsres']) + float(dict_region['ewres']))/2
ValueError: invalid literal for float(): 0:00:00.17656
2) should faill more gracefully. LL location is not supported. Feel
free to open a ticket in trac.
On Fri, May 24, 2019 at 6:36 PM Martin Landa <landa.martin@gmail.com> wrote:
Hi,
pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo <diregola@gmail.com> napsal:
> as far as I remember, it worked only in projected coordinate system.
1) should be mentioned in manual at least
+1 - TODO
>> Traceback (most recent call last):
>> File "/home/lara/.grass7/addons/scripts/r.hazard.flood", line 145, in <module>
>> sys.exit(main())
>> File "/home/lara/.grass7/addons/scripts/r.hazard.flood", line 78, in main
>> resolution = (float(dict_region['nsres']) + float(dict_region['ewres']))/2
>> ValueError: invalid literal for float(): 0:00:00.17656
2) should faill more gracefully. LL location is not supported.
pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo <diregola@gmail.com> napsal:
as far as I remember, it worked only in projected coordinate system.
should be mentioned in manual at least
+1 - TODO
Done
Traceback (most recent call last):
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 145, in
sys.exit(main())
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 78, in main
resolution = (float(dict_region[‘nsres’]) + float(dict_region[‘ewres’]))/2
ValueError: invalid literal for float(): 0:00:00.17656
should faill more gracefully. LL location is not supported.
pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo <diregola@gmail.com> napsal:
as far as I remember, it worked only in projected coordinate system.
should be mentioned in manual at least
+1 - TODO
Done
Traceback (most recent call last):
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 145, in
sys.exit(main())
File “/home/lara/.grass7/addons/scripts/r.hazard.flood”, line 78, in main
resolution = (float(dict_region[‘nsres’]) + float(dict_region[‘ewres’]))/2
ValueError: invalid literal for float(): 0:00:00.17656
should faill more gracefully. LL location is not supported.
A simple solution would be
dict_region = grass.region()
instead of
info_region = grass.read_command(‘g.region’, flags = ‘p’)
dict_region = grass.parse_key_val(info_region, ‘:’)
but that does not solve the problem of resolution being in degrees. For ll, you would need to get the resolution for each raster row separately, or estimate with
r.mapcalc “ll_resolution = sqrt(area())”
which probably doesn’t make sense for higher latitudes.