[GRASS-user] r.hazard.flood extension

Markus Metz markus.metz.giswork at gmail.com
Tue Jun 11 01:54:24 PDT 2019


On Fri, Jun 7, 2019 at 10:44 AM Margherita Di Leo <diregola at gmail.com>
wrote:
>
>
>
> On Fri, Jun 7, 2019 at 12:16 AM Markus Neteler <neteler at osgeo.org> wrote:
>>
>> On Fri, May 24, 2019 at 6:36 PM Martin Landa <landa.martin at gmail.com>
wrote:
>> >
>> > Hi,
>> >
>> > pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo <diregola at 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
>
>
> Done
>>
>>
>> > >> 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.
>>
>> https://github.com/OSGeo/grass-addons/pull/4
>
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.

Markus M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190611/247a8bd8/attachment.html>


More information about the grass-user mailing list