Re: [GRASS-user] r.hazard.flood extension
On Fri, Jun 7, 2019 at 10:44 AM Margherita Di Leo wrote: > > > > On Fri, Jun 7, 2019 at 12:16 AM Markus Neteler wrote: >> >> On Fri, May 24, 2019 at 6:36 PM Martin Landa wrote: >> > >> > Hi, >> > >> > pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo 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 >> > >> 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 ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood extension
On Fri, Jun 7, 2019 at 12:16 AM Markus Neteler wrote: > On Fri, May 24, 2019 at 6:36 PM Martin Landa > wrote: > > > > Hi, > > > > pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo > 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 > > > >> 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 Thank you Markus. Cheers, -- Margherita Di Leo ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood extension
On Fri, May 24, 2019 at 6:36 PM Martin Landa wrote: > > Hi, > > pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo > 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 > >> > >> 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 Markus ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood extension
Hi, pá 24. 5. 2019 v 15:48 odesílatel Margherita Di Leo 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 >> >> 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. Ma -- Martin Landa http://geo.fsv.cvut.cz/gwiki/Landa http://gismentors.cz/mentors/landa ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood extension
Thanks Margherita ! you were right! Kind regards, Lara El vie., 24 de may. de 2019 a la(s) 10:48, Margherita Di Leo ( direg...@gmail.com) escribió: > Hi Lara, > > as far as I remember, it worked only in projected coordinate system. > > Hope this helps, > Kind regards, > > On Fri, May 24, 2019 at 3:41 PM Lara DC wrote: > >> 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. >> >> Hope to solve this! >> >> Lara >> >> ___ >> grass-user mailing list >> grass-user@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/grass-user > > > > -- > Margherita Di Leo > ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood extension
Hi Lara, as far as I remember, it worked only in projected coordinate system. Hope this helps, Kind regards, On Fri, May 24, 2019 at 3:41 PM Lara DC wrote: > 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. > > Hope to solve this! > > Lara > > ___ > grass-user mailing list > grass-user@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/grass-user -- Margherita Di Leo ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood extension
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. Hope to solve this! Lara ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood erroneous results.
Dear community,I gave a try to r.hazard.flood and got som erroneous results, that indicate flood hazard (value 1) on the hillsides. Is that possible? I am running r.flood.hazard in GRASS GIS 7.2.0 on a windows 10 machine. The DTM used has 1m resolution. Not error messages are produced-- (below the command output), but the results do not represent the reality. The MTI map on the other hand, looks correct to me. Negative values on the hillside and positive values in the floodplain (see attachments). (Fri Feb 24 07:54:22 2017) r.hazard.flood --overwrite map=driva_sk_1m@PERMANENT flood=floodHazard mti=MTIFlood Cellsize : 1.0 SECTION 1a (of 4): Initiating Memory. SECTION 1b (of 4): Determining Offmap Flow. SECTION 2: A* Search. SECTION 3a: Accumulating Surface Flow with MFD. SECTION 3b: Adjusting drainage directions. SECTION 4: Closing Maps. Writing out only positive flow accumulation values. Cells with a likely underestimate for flow accumulation can no longer be identified. Flow accumulation done. Slope raster map complete Slope map done. Exponent : 0.016 MTI threshold : 2.45624 Calculating MTI raster map.. Cleaning up.. Calculating flood raster map.. Running r.clump.. Pass 1 of 2... Generating renumbering scheme... Pass 2 of 2... r.clump complete. 19533 clumps. Deleting areas of less than 100 cells.. Reading... Writing... Done! Cleaning up.. Removing raster Removing raster Removing raster Done. (Fri Feb 24 07:54:53 2017) Command finished (31 sec) Some other statistics... r.univar map=MTIFlood@PERMANENT total null and non-null cells: 9016440 total null cells: 77829 Of the non-null cells: -- n: 8938611 minimum: -3.67184 maximum: 11.1875 range: 14.8593 mean: 1.74111 mean of absolute values: 1.95274 standard deviation: 2.18821 variance: 4.78828 variation coefficient: 125.679 % sum: 15563100.8518932 (Fri Feb 24 08:05:33 2017) Command finished (1 sec) I would appreciate any hint.Have a nice Weekend Rengifo ___ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
Hi, On Sun, Mar 13, 2016 at 4:57 PM, edgar mlowe wrote: > Am working on developing flood hazard map using the module r.hazard.flood. > Whenever I try to run the module I get the following error > > (Sun Mar 13 23:43:19 > 2016) > r.hazard.flood map=floodanalysis.alpha@edgar flood=flood > mti=MTI > Traceback (most recent call last): > File "/home/edgar/.grass6/addons/r.hazard.flood", line > 145, in > sys.exit(main()) > File "/home/edgar/.grass6/addons/r.hazard.flood", line 80, > in main > resolution = (float(dict_region['nsres']) + > float(dict_region['ewres']))/2 > ValueError: invalid literal for float(): 0:00:00.09 > (Sun Mar 13 23:43:20 2016) Command finished (0 sec) > > Please if I may get more help on how to use r.hazard.flood to produce > flood hazard maps. thanks in advance > it looks like you are using it in an unprojected location (latitude-longitude), try to reproject your data into a location with suitable projection. However, the module should be able to deal with this somehow (either enable it or finish with appropriate error message), so you should create a ticket for this bug. Best, Anna > > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood
Am working on developing flood hazard map using the module r.hazard.flood. Whenever I try to run the module I get the following error (Sun Mar 13 23:43:19 2016) r.hazard.flood map=floodanalysis.alpha@edgar flood=flood mti=MTI Traceback (most recent call last): File "/home/edgar/.grass6/addons/r.hazard.flood", line 145, in sys.exit(main()) File "/home/edgar/.grass6/addons/r.hazard.flood", line 80, in main resolution = (float(dict_region['nsres']) + float(dict_region['ewres']))/2 ValueError: invalid literal for float(): 0:00:00.09 (Sun Mar 13 23:43:20 2016) Command finished (0 sec) Please if I may get more help on how to use r.hazard.flood to produce flood hazard maps. thanks in advance ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
On Tue, Jul 8, 2014 at 4:29 AM, Hamish wrote: > Leo wrote: > > > Cellsize : 118.28096836 > > > SECTION 1a (of 4): Initiating Memory. > > > Current region rows: 17433, cols: 17539 > > > ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at > > > init_vars.c:134 > > > WARNING: Subprocess failed with exit code 1 > > Madi: > > This log suggests that r.watershed, called by r.hazard.flood, is not > > able to finish the job due to lack of memory. > > [@devs] > in bash you can do a test "if [ $? -ne 0 ] ; then" to see if r.watershed > finished correctly and go to a 'g.message -e' and 'exit 1' if it > failed. r.hazard.flood is a python script, how to apply the same to > grass.run_command() before claiming success and continuing? > > In case of run_command you should check the return value which is the exit code of the module. ret = run_command('g.region', s=0, n=5, w=0, e=5, res=1) if ret != 0: grass.script.fatal(_("g.region failed, see the error message above")) It is actually designed to resemble the calls in shell which I don't think is a right think to do, so please see ticket #2326. [doc] http://grass.osgeo.org/programming7/namespacepython_1_1script_1_1core.html#a0cbf4805e1691904c8245037ea359c71 [src] http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/script/core.py#L352 [ticket] http://trac.osgeo.org/grass/ticket/2326 > > regards, > > -- > Hamish > . > Thought I should join the Yahoo mail diaspora before 30 days > worth of my emails got flushed from everyone's spam boxes never > to be seen again. In the last weeks some have made it to the ML > archives at least, if not to end recipients. Others seem to have > just disappeared into /dev/null. It didn't help that the web > interface had become an unusable gibberish of broken JavaScript > and their IMAP would only transfer the oldest 4% of my inbox. > . > http://www.ietf.org/mail-archive/web/ietf/current/msg87153.html > > http://www.spamresource.com/2014/04/up-in-arms-about-yahoos-dmarc-policy.html > http://wiki.list.org/pages/viewpage.action?pageId=17891458 > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
Leo wrote: > > Cellsize : 118.28096836 > > SECTION 1a (of 4): Initiating Memory. > > Current region rows: 17433, cols: 17539 > > ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at > > init_vars.c:134 > > WARNING: Subprocess failed with exit code 1 Madi: > This log suggests that r.watershed, called by r.hazard.flood, is not > able to finish the job due to lack of memory. [@devs] in bash you can do a test "if [ $? -ne 0 ] ; then" to see if r.watershed finished correctly and go to a 'g.message -e' and 'exit 1' if it failed. r.hazard.flood is a python script, how to apply the same to grass.run_command() before claiming success and continuing? regards, -- Hamish . Thought I should join the Yahoo mail diaspora before 30 days worth of my emails got flushed from everyone's spam boxes never to be seen again. In the last weeks some have made it to the ML archives at least, if not to end recipients. Others seem to have just disappeared into /dev/null. It didn't help that the web interface had become an unusable gibberish of broken JavaScript and their IMAP would only transfer the oldest 4% of my inbox. . http://www.ietf.org/mail-archive/web/ietf/current/msg87153.html http://www.spamresource.com/2014/04/up-in-arms-about-yahoos-dmarc-policy.html http://wiki.list.org/pages/viewpage.action?pageId=17891458 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
Hi Leo, On Mon, Jul 7, 2014 at 3:31 AM, Leo Kris Palao wrote: > Hi Madi, > > I got it working now. I think that my DEM is so big (one country). I > created a subset and it is now working. Is there a way where I can just > choose my region of interest from my country-wide DEM and then process it? > Right now what I am doing is to clip the DEM to create a subset and process > it. > if you set the computational region to the extent of interest, the module does the computation of the smaller area. HTH, madi -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
Hi Madi, I got it working now. I think that my DEM is so big (one country). I created a subset and it is now working. Is there a way where I can just choose my region of interest from my country-wide DEM and then process it? Right now what I am doing is to clip the DEM to create a subset and process it. Hope my query is clear. Thanks, -Leo On Fri, Jul 4, 2014 at 5:45 PM, Margherita Di Leo wrote: > Hi Leo, > > > On Fri, Jul 4, 2014 at 11:37 AM, Leo Kris Palao > wrote: > >> Dear GRASS users, >> >> I want to use r.hazard.flood module of GRASS but could not get it to >> work. I am running it in the command console. My expression is: >> r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti >> >> Below is the error that I am getting. I have also r.area installed. >> >> The projection of my Map is in Sinusoidal. I have my GRASS installed via >> the OSGeo4W installer, as I use this method to install QGIS. >> >> I am using Windows 7 Professional OS 64-bit >> My GRASS version is 6.4.3 >> >> Another question: Is there a GUI for this module in the Windows version >> of GRASS? >> >> Thanks, >> -Leo >> >> Error message: >> r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti >> >> Cellsize : 118.28096836 >> SECTION 1a (of 4): Initiating Memory. >> Current region rows: 17433, cols: 17539 >> ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at >> init_vars.c:134 >> WARNING: Subprocess failed with exit code 1 >> WARNING: category information for [r_accumulation] in [LPalao] missing or >> invalid >> Flow accumulation done. >> Slope raster map complete >> Slope map done. >> Exponent : 0.143767534008 >> MTI threshold : 3.84762844534 >> Calculating MTI raster map.. >> Invalid map >> Parse error >> ERROR: An error occurred while running r.mapcalc >> (Fri Jul 04 17:21:32 2014) Command finished (1 min 23 sec) >> > > This log suggests that r.watershed, called by r.hazard.flood, is not able > to finish the job due to lack of memory. Could you please check if the > computational region is set correctly and then if you can run r.watershed > separately? > The GUI for this module should be available on the fly as any other > modules.. what if you type r.hazard.flood --ui ? > > Cheers, > madi > >> > > > -- > Best regards, > > Dr. Margherita DI LEO > Scientific / technical project officer > > European Commission - DG JRC > Institute for Environment and Sustainability (IES) > Via Fermi, 2749 > I-21027 Ispra (VA) - Italy - TP 261 > > Tel. +39 0332 78 3600 > margherita.di-...@jrc.ec.europa.eu > > Disclaimer: The views expressed are purely those of the writer and may not > in any circumstance be regarded as stating an official position of the > European Commission. > -- *LEO KRIS MARIANO PALAO* International Rice Research Institute Website: www.irri.org Official Email: l.pa...@irri.org ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood
Hi Leo, On Fri, Jul 4, 2014 at 11:37 AM, Leo Kris Palao wrote: > Dear GRASS users, > > I want to use r.hazard.flood module of GRASS but could not get it to work. > I am running it in the command console. My expression is: > r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti > > Below is the error that I am getting. I have also r.area installed. > > The projection of my Map is in Sinusoidal. I have my GRASS installed via > the OSGeo4W installer, as I use this method to install QGIS. > > I am using Windows 7 Professional OS 64-bit > My GRASS version is 6.4.3 > > Another question: Is there a GUI for this module in the Windows version of > GRASS? > > Thanks, > -Leo > > Error message: > r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti > > Cellsize : 118.28096836 > SECTION 1a (of 4): Initiating Memory. > Current region rows: 17433, cols: 17539 > ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at > init_vars.c:134 > WARNING: Subprocess failed with exit code 1 > WARNING: category information for [r_accumulation] in [LPalao] missing or > invalid > Flow accumulation done. > Slope raster map complete > Slope map done. > Exponent : 0.143767534008 > MTI threshold : 3.84762844534 > Calculating MTI raster map.. > Invalid map > Parse error > ERROR: An error occurred while running r.mapcalc > (Fri Jul 04 17:21:32 2014) Command finished (1 min 23 sec) > This log suggests that r.watershed, called by r.hazard.flood, is not able to finish the job due to lack of memory. Could you please check if the computational region is set correctly and then if you can run r.watershed separately? The GUI for this module should be available on the fly as any other modules.. what if you type r.hazard.flood --ui ? Cheers, madi > -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood
Dear GRASS users, I want to use r.hazard.flood module of GRASS but could not get it to work. I am running it in the command console. My expression is: r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti Below is the error that I am getting. I have also r.area installed. The projection of my Map is in Sinusoidal. I have my GRASS installed via the OSGeo4W installer, as I use this method to install QGIS. I am using Windows 7 Professional OS 64-bit My GRASS version is 6.4.3 Another question: Is there a GUI for this module in the Windows version of GRASS? Thanks, -Leo Error message: r.hazard.flood map=myanmar_dem_modis flood=flood mti=mti Cellsize : 118.28096836 SECTION 1a (of 4): Initiating Memory. Current region rows: 17433, cols: 17539 ERROR: G_malloc: unable to allocate 2448854040 bytes of memory at init_vars.c:134 WARNING: Subprocess failed with exit code 1 WARNING: category information for [r_accumulation] in [LPalao] missing or invalid Flow accumulation done. Slope raster map complete Slope map done. Exponent : 0.143767534008 MTI threshold : 3.84762844534 Calculating MTI raster map.. Invalid map Parse error ERROR: An error occurred while running r.mapcalc (Fri Jul 04 17:21:32 2014) Command finished (1 min 23 sec) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood does not respect region settings?
Hi, sorry for late answer, I had overlooked this email On Fri, Mar 7, 2014 at 7:30 AM, Hamish wrote: > maning wrote: > > > I'm testing r.hazard.flood and noticed that it computes the flood and > > mti layers on the full region of the elevation raster instead of the > > pre-defined region settings. > > > > The relvant code I found from the r.hazard.flood is this: > ># Detect cellsize of the DEM > > info_region = grass.read_command('g.region', flags = 'p', > > rast = > > '%s' % (r_elevation)) > > dict_region = grass.parse_key_val(info_region, ':') > > resolution = (float(dict_region['nsres']) + > > float(dict_region['ewres']))/2 > > grass.message("Cellsize : %s " % resolution) > > > > Would it be possible to either respect the current region settings or > > add a flag to choose between the dem region settings or current region > > settings? > > > if it needs to detect the original raster cell resolution (usually that's > only needed to avoid aliasing artifacts in certain situations) it should > use r.info to get the answer. I'm guessing due to the averaging of the ew > and ns resolutions avoiding aliasing isn't the case. > > if a module wants to change the region (and almost none should ever do > that except for g.region by itself) it should set up a temporary > WIND_OVERRIDE first, in the case of python scripting there is an easy grass > python function to make that and clean it up at the end. (otherwise > parallel jobs get their regions messed up mid-run, and region changes > without you expecting it will) > > I suspect grass.raster's raster_info() is the better way for > r.hazard.flood to do what it's trying to do now. But also just querying the > current g.region info without changing anything is probably even better, as > that is what the other raster commands will expect to use. If the user > should align perfectly with the input map first, it should be noted in the > help page for them to do it manually before running the module. > Thanks for suggestion, applied in r59879 Cheers, madi -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood does not respect region settings?
maning wrote: > I'm testing r.hazard.flood and noticed that it computes the flood and > mti layers on the full region of the elevation raster instead of the > pre-defined region settings. > > The relvant code I found from the r.hazard.flood is this: > # Detect cellsize of the DEM > info_region = grass.read_command('g.region', flags = 'p', > rast = > '%s' % (r_elevation)) > dict_region = grass.parse_key_val(info_region, ':') > resolution = (float(dict_region['nsres']) + > float(dict_region['ewres']))/2 > grass.message("Cellsize : %s " % resolution) > > Would it be possible to either respect the current region settings or > add a flag to choose between the dem region settings or current region > settings? if it needs to detect the original raster cell resolution (usually that's only needed to avoid aliasing artifacts in certain situations) it should use r.info to get the answer. I'm guessing due to the averaging of the ew and ns resolutions avoiding aliasing isn't the case. if a module wants to change the region (and almost none should ever do that except for g.region by itself) it should set up a temporary WIND_OVERRIDE first, in the case of python scripting there is an easy grass python function to make that and clean it up at the end. (otherwise parallel jobs get their regions messed up mid-run, and region changes without you expecting it will) I suspect grass.raster's raster_info() is the better way for r.hazard.flood to do what it's trying to do now. But also just querying the current g.region info without changing anything is probably even better, as that is what the other raster commands will expect to use. If the user should align perfectly with the input map first, it should be noted in the help page for them to do it manually before running the module. regards, Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood does not respect region settings?
Hi, I'm testing r.hazard.flood and noticed that it computes the flood and mti layers on the full region of the elevation raster instead of the pre-defined region settings. The relvant code I found from the r.hazard.flood is this: # Detect cellsize of the DEM info_region = grass.read_command('g.region', flags = 'p', rast = '%s' % (r_elevation)) dict_region = grass.parse_key_val(info_region, ':') resolution = (float(dict_region['nsres']) + float(dict_region['ewres']))/2 grass.message("Cellsize : %s " % resolution) Would it be possible to either respect the current region settings or add a flag to choose between the dem region settings or current region settings? -- cheers, maning -- "Freedom is still the most radical idea of all" -N.Branden wiki: http://esambale.wikispaces.com/ blog: http://epsg4253.wordpress.com/ -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood white map flood output
Thanks Mattia, what I think it happens is that the areas individuated (those which exceed the MTI threshold : 2.47170118814) are too small and are being deleted by r.area afterwards. I'm most interested in pushing this testing beyond, as the module is the implementation of an experimental procedure developed by us, so if you are available to do further tests I'd follow up this off list. Let me know if you are available. Thanks m On Fri, Jun 14, 2013 at 11:26 AM, M. Riccadonna wrote: > sure, ok! > > > | Range of data:min = -3.09747448418923 max = 11.1769558173435 >| > > -- Best regards, Margherita DI LEO Postdoctoral Researcher European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood white map flood output
Thank you Mattia, and what does r.info zz_MTI say? -- Best regards, Margherita DI LEO Postdoctoral Researcher European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood white map flood output
Hi, On Fri, Jun 14, 2013 at 10:27 AM, M. Riccadonna wrote: > Hi all, > I launched r.hazard.flood script and the command ended in the right way. > MTI > map output looks right, but for the flood map I have is a 'white' map, can > anyone suggest me the reason? > I guess g.region, but it's hard to diagnose without the patient clinic test results being provided ;-). Could you please attach the log of the run and the results of g.region -p and r.info your_dem Thanks madi -- Best regards, Margherita DI LEO Postdoctoral Researcher European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood white map flood output
Hi all, I launched r.hazard.flood script and the command ended in the right way. MTI map output looks right, but for the flood map I have is a 'white' map, can anyone suggest me the reason? m ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
On Fri, Jun 14, 2013 at 9:19 AM, RichardC wrote: > Just to confirm (and for reference) the successful running of r.hazard.flood > on GRASS 7 svn (code revision 56683) (configured with --enable-largefile), > and with the following 'flags' change to r.hazard.flood.py: > > from > # Flow accumulation map MFD > grass.run_command('r.watershed', elevation = r_elevation , accumulation > = 'r_accumulation' , convergence = 5, flags = 'a') > grass.message("Flow accumulation done. ") > > to > # Flow accumulation map MFD > grass.run_command('r.watershed', elevation = r_elevation , accumulation > = 'r_accumulation' , convergence = 5, flags = 'am') > grass.message("Flow accumulation done. ") > Nice, thanks for the feedback! Markus M ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
Just to confirm (and for reference) the successful running of r.hazard.flood on GRASS 7 svn (code revision 56683) (configured with --enable-largefile), and with the following 'flags' change to r.hazard.flood.py: from # Flow accumulation map MFD grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'a') grass.message("Flow accumulation done. ") to # Flow accumulation map MFD grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'am') grass.message("Flow accumulation done. ") -- View this message in context: http://osgeo-org.1560.x6.nabble.com/r-hazard-flood-ERROR-G-malloc-r-accumulation-tp5059130p5060063.html Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
On Tue, Jun 11, 2013 at 6:36 AM, RichardC wrote: > Thanks for your suggestions. > > I modified the following: > > /home/user/.grass6/addons/scripts/r.hazard.flood, replacing: > > # Flow accumulation map MFD > grass.run_command('r.watershed', elevation = r_elevation , accumulation > = 'r_accumulation' , convergence = 5, flags = 'fa') > grass.message("Flow accumulation done. ") > > with > > # Flow accumulation map MFD > grass.run_command('r.watershed', elevation = r_elevation , accumulation > = 'r_accumulation' , convergence = 5, flags = 'am') For GRASS 6, you should keep the -f flag for MFD. > grass.message("Flow accumulation done. ") > > This enabled me run r.hazard.flow on a portion (sub-basin) of the DEM. I ran > into trouble if I attempted the larger mosaic I created, as follows: > > r.hazard.flood.py map=ASTGTM_composite_all@PERMANENT > flood=ASTGTM_composite_all_flood mti=ASTGTM_composite_all_mti > Cellsize : 30.0 > SECTION 1 beginning: Initiating Variables. 4 sections total. > WARNING: segment zero_fill(): Unable to write (No such file or directory) This warning indicates that either you were running out of disk space or the temporary file would be larger than supported (GRASS 6 has no global Large File Support), or both. > WARNING: seg_open(): could not write segment file > SECTION 1b (of 4): Determining Offmap Flow. > Floating point exception (core dumped) > WARNING: Subprocess failed with exit code 34816 > WARNING: category information for [r_accumulation] in [PERMANENT] missing or > invalid > Flow accumulation done. > Slope raster map complete > Slope map done. > Exponent : 0.076488432313 > MTI threshold : 3.11495902789 > Calculating mti raster map.. > Invalid map > Parse error > ERROR: An error occurred while running r.mapcalc > (Tue Jun 11 10:55:33 2013) Command finished (9 min 3 sec) > > I guess the workaround solution is to reduce the spatial extent and run each > sub-basin separately with r.hazard.flood (if possible for all I'm not sure) > > Install GRASS 7 - installing from source into my home directory I think > should allow two systems to work on my machine ... That would work, I have 4 different GRASS versions running on my machine. Note that you do not need to run 'make install' in order to use GRASS. > > > My current system: > > uname -a: Linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC > 2012 i686 i686 i386 GNU/Linux You are using a 32 bit system (why?), therefore you need to configure GRASS with --enable-largefile. HTH, Markus M > > I'm running Linux Mint 13 (Maya) which is based on Ubuntu Precise (installed > system wide via package manager) > > GRASS version: 6.4.3 (Python 2.7.3/wxpython 2.8.12.1) > GRASS: 6.4.3-1~svn54876~precise1 > > NB: I just noticed that the repo has been updated with 6.4.3 (RC3-4) ... > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/r-hazard-flood-ERROR-G-malloc-r-accumulation-tp5059130p5059281.html > Sent from the Grass - Users mailing list archive at Nabble.com. > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
Thanks for your suggestions. I modified the following: /home/user/.grass6/addons/scripts/r.hazard.flood, replacing: # Flow accumulation map MFD grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'fa') grass.message("Flow accumulation done. ") with # Flow accumulation map MFD grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'am') grass.message("Flow accumulation done. ") This enabled me run r.hazard.flow on a portion (sub-basin) of the DEM. I ran into trouble if I attempted the larger mosaic I created, as follows: r.hazard.flood.py map=ASTGTM_composite_all@PERMANENT flood=ASTGTM_composite_all_flood mti=ASTGTM_composite_all_mti Cellsize : 30.0 SECTION 1 beginning: Initiating Variables. 4 sections total. WARNING: segment zero_fill(): Unable to write (No such file or directory) WARNING: seg_open(): could not write segment file SECTION 1b (of 4): Determining Offmap Flow. Floating point exception (core dumped) WARNING: Subprocess failed with exit code 34816 WARNING: category information for [r_accumulation] in [PERMANENT] missing or invalid Flow accumulation done. Slope raster map complete Slope map done. Exponent : 0.076488432313 MTI threshold : 3.11495902789 Calculating mti raster map.. Invalid map Parse error ERROR: An error occurred while running r.mapcalc (Tue Jun 11 10:55:33 2013) Command finished (9 min 3 sec) I guess the workaround solution is to reduce the spatial extent and run each sub-basin separately with r.hazard.flood (if possible for all I'm not sure) Install GRASS 7 - installing from source into my home directory I think should allow two systems to work on my machine ... My current system: uname -a: Linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 2012 i686 i686 i386 GNU/Linux I'm running Linux Mint 13 (Maya) which is based on Ubuntu Precise (installed system wide via package manager) GRASS version: 6.4.3 (Python 2.7.3/wxpython 2.8.12.1) GRASS: 6.4.3-1~svn54876~precise1 NB: I just noticed that the repo has been updated with 6.4.3 (RC3-4) ... -- View this message in context: http://osgeo-org.1560.x6.nabble.com/r-hazard-flood-ERROR-G-malloc-r-accumulation-tp5059130p5059281.html Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
On Mon, Jun 10, 2013 at 3:54 PM, RichardC wrote: > Hi, > > Maybe some one could kindly advise what I'm doing wrong here. > > Previously I successfully used r.hazard.flood to generate flood and mti > layers. However, now I'm encountering the following error with two other > different DEM layers. The error appears to be related to memory, but there > is plenty of RAM free (6GB) and I still get the error with a DEM subset of > only 5MB in size. Also, I'm able to repeat the r.hazard.flood process > successfully using the first DEM I tried, so it would seem to be related to > the DEMs? > > I've set g.region - selecting the raster file to be used with r.hazard.flood > and resolution (in meters). > > Thanks for your suggestions, > > Richard > > > r.hazard.flood.py map=ASTGTM_composite_all_de@PERMANENT > flood=ASTGTM_composite_all_delta_flood mti=ASTGTM_composite_all_delta_mti > Cellsize : 30.0 > SECTION 1a (of 4): Initiating Memory. > Current region rows: 17981, cols: 11271 > ERROR: G_malloc: unable to allocate 811437852 bytes of memory at > init_vars.c:136 You could modify the r.hazard.flood.py python script such that it calls r.watershed with the memory-safe option,: replace grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'a') with grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'am') HTH, Markus M > WARNING: Subprocess failed with exit code 256 > WARNING: category information for [r_accumulation] in [PERMANENT] missing or > invalid > Flow accumulation done. > Slope raster map complete > Slope map done. > Exponent : 0.076488432313 > MTI threshold : 3.11495902789 > Calculating mti raster map.. > Invalid map > Parse error > ERROR: An error occurred while running r.mapcalc > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/r-hazard-flood-ERROR-G-malloc-r-accumulation-tp5059130.html > Sent from the Grass - Users mailing list archive at Nabble.com. > ___ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
On Mon, Jun 10, 2013 at 3:54 PM, RichardC wrote: > Hi, > > Maybe some one could kindly advise what I'm doing wrong here. > > Previously I successfully used r.hazard.flood to generate flood and mti > layers. However, now I'm encountering the following error with two other > different DEM layers. The error appears to be related to memory, but there ... > r.hazard.flood.py map=ASTGTM_composite_all_de@PERMANENT > flood=ASTGTM_composite_all_delta_flood mti=ASTGTM_composite_all_delta_mti > Cellsize : 30.0 > SECTION 1a (of 4): Initiating Memory. > Current region rows: 17981, cols: 11271 > ERROR: G_malloc: unable to allocate 811437852 bytes of memory at > init_vars.c:136 I guess that you are exceeding the 32bit specifications of your PC, if - you are on a 32bit PC - without Large file Support enabled (note that it is better implemented in GRASS 7) How to find out: > 17981 * 11271 [1] 202663851 > 2^31 [1] 2147483648 # check uname -a ... and tell us which GRASS Version you use on which system. Also check if the computation region is as desired (g.region). hope this helps Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] r.hazard.flood: ERROR_G_malloc: r_accumulation
Hi, Maybe some one could kindly advise what I'm doing wrong here. Previously I successfully used r.hazard.flood to generate flood and mti layers. However, now I'm encountering the following error with two other different DEM layers. The error appears to be related to memory, but there is plenty of RAM free (6GB) and I still get the error with a DEM subset of only 5MB in size. Also, I'm able to repeat the r.hazard.flood process successfully using the first DEM I tried, so it would seem to be related to the DEMs? I've set g.region - selecting the raster file to be used with r.hazard.flood and resolution (in meters). Thanks for your suggestions, Richard r.hazard.flood.py map=ASTGTM_composite_all_de@PERMANENT flood=ASTGTM_composite_all_delta_flood mti=ASTGTM_composite_all_delta_mti Cellsize : 30.0 SECTION 1a (of 4): Initiating Memory. Current region rows: 17981, cols: 11271 ERROR: G_malloc: unable to allocate 811437852 bytes of memory at init_vars.c:136 WARNING: Subprocess failed with exit code 256 WARNING: category information for [r_accumulation] in [PERMANENT] missing or invalid Flow accumulation done. Slope raster map complete Slope map done. Exponent : 0.076488432313 MTI threshold : 3.11495902789 Calculating mti raster map.. Invalid map Parse error ERROR: An error occurred while running r.mapcalc -- View this message in context: http://osgeo-org.1560.x6.nabble.com/r-hazard-flood-ERROR-G-malloc-r-accumulation-tp5059130.html Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user