<div dir="ltr"><div><div><div><div><div><div>Hi Daniel,<br><br></div>concerning your first point, you could try to run simpler calculations of your quite nested mapcalc expression, in order<br></div>to pin down which cells cause problems at certain levels of calculations. Eg. just run a simpler mapcalculation like and identify the levels of calculation and cells that cause your problem:<br>
<font face="arial, helvetica, sans-serif"> simple1=abs(tan( "slope_in_degree" )+0.05)</font><br></div> simpe2=<font face="arial, helvetica, sans-serif">exp(3.5*(simple1))<br></font></div><font face="arial, helvetica, sans-serif"><br>
</font></div><font face="arial, helvetica, sans-serif">Maybe you can also provide a small reproducable example (with the NorthCaroline Sample Dataset if possible)<br></font></div><font face="arial, helvetica, sans-serif">/Johannes<br>
</font></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 24, 2014 at 10:15 AM, Daniel Becker <span dir="ltr"><<a href="mailto:danielbecker82@gmail.com" target="_blank">danielbecker82@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>i just joined this mailing list and i hope i'm doing everything right. <br>
<br>I'm
 in a project where i try to provide an easy way to do a cost-distance 
analysis, based on a given raster DEM, i did this with ArcGIS earlier but i want
 more people to be able to use this simple (and faster) approach, but i ran into some
 problems.</div>
<div><br></div><div><br></div><div><br></div><div>The workflow looks like this:</div><div><br></div><div><font face="arial, helvetica, sans-serif">DEM
 -> slope -> r.mapcalc(tobler hiking function) -> cost raster 
-> r.cost -> cost distance raster -> contours that represent 
walking distance from a given point.<br>
<br>The function i use in r.mapcalc is: h/m=(0.000166666*(exp(3.5*(abs(tan( "slope_in_degree" )+0.05)))))*cellsize</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br>


</font></div><div><font face="arial, helvetica, sans-serif">The problems i ran into:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><ol><li><font face="arial, helvetica, sans-serif">This
 works with SRTM-data, but if i use a higher resolution DEM (10m), the 
resulting cost raster contains some infinite values and the r.cost tool 
doesn't really work anymore<br>
</font></li><ul><li><font face="arial, helvetica, sans-serif">Is there a way to adress "inf" in r.mapcalc? I can just filter everything > 500, but that isn't really satisfying. :)<br></font></li><li><font face="arial, helvetica, sans-serif">I
 don't really know what the underlying problem is, exp() leads to the 
infinite values, but maybe there is a way to filter those extreme slopes
 earlier or in the DEM (although the slope raster contains only values 
<90°)?<br>
<br></font></li></ul><li><font face="arial, helvetica, sans-serif"><span style="line-height:107%" lang="EN-GB">ERROR:
G_malloc: unable to allocate 524288 bytes of memory at setup.c:64 - happens at </span><span style="line-height:107%" lang="EN-GB">144.024.001
 pixels (merged SRTM-DEM of Spain) and above if i don't set "Percent of 
map to keep in memory" to quite low values of below 20-30%, although 
neither my RAM nor the harddrive with the .tmp-folder is fully utilized. The problem is: What 
happens at even higher pixelcounts?<br>
<br></span></font></li><li><span style="line-height:107%" lang="EN-GB"><font face="arial, helvetica, sans-serif">This
 may be the wrong place for this but: Usability-wise it would be even 
nicer to use QGIS and its modelbuilder for this approach. The problem is
 that the parameters for stop_point or stop_coordinate can't stay empty 
in the QGIS-GUI (which it has to be, since the whole raster should be 
processed). Maybe there is a way to work around this?<br>
<br></font></span></li></ol><div><span style="line-height:15.6933px"><font face="arial, helvetica, sans-serif">So, i'd be happy if someone could help me. Here is also an example (</font></span><font face="arial, helvetica, sans-serif"><span style="line-height:15.6933px"><a href="https://www.dropbox.com/s/i6rsm9v9p7gwfx2/01_isochronen_arroyotobler_ardales.png" target="_blank">https://www.dropbox.com/s/i6rsm9v9p7gwfx2/01_isochronen_arroyotobler_ardales.png</a>)</span></font><span style="font-family:arial,helvetica,sans-serif;line-height:15.6933px"> of what i'm trying to do, so that it's less abstract. :-)<br>


<br><br>Thanks in advance and have a nice week<span class="HOEnZb"><font color="#888888"><br><br></font></span></span></div><span class="HOEnZb"><font color="#888888"><div><span style="font-family:arial,helvetica,sans-serif;line-height:15.6933px">Daniel<br>
</span></div></font></span></div></div>
<br>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote></div><br></div>