As a follow up to How can I estimate a Least Cost Path in Google Earth Engine?, I am still trying to estimate walking time in Google Earth Engine based on a slope-based cost equation using the cumulativeCost function. I don't understand why the result is so much faster than in ArcGIS 10.6 (using the same 30m SRTM DEM). As far as I can tell, GEE cannot calculate slope based on travel direction, so I am using an equation that doesn't distinguish travel direction – for example, walking time is the same at -5 and +5° (Rees 2004). The formula is in meters per second, which I divided by 3600 to get hours per meter. It looks like this in Excel:
Is this correct?
var slope_in_radians = slope.multiply(3.1415).divide(180); var cost = ( (ee.Image(0.75).add( ee.Image(0.09).multiply( slope_in_radians.tan().abs() ) ).add( ee.Image(14.6).multiply( slope_in_radians.tan().abs() .multiply(ee.Number(2).exp() )))).divide(3600) );
(I liked his suggestion of the simpler ee.Image.expression() syntax, but I couldn't get it to work; the error was that "abs" was not defined).
This code gives me a reasonable result that shows travel time increases in steeper areas (the white rings should be contour lines in hours):
However, when we ran the same analysis in ArcMap 10.6 (from Steve Wernke!), we got a much slower and more realistic result (~4 km are traversed in about an hour, as expected). It is also similar to other cost equations we ran in ArcMap, so I think something is wrong with the GEE result.
How can I get GEE to produce the same results as ArcGIS?
Here's the relevant part of Rees 2004 (I used equation 1).