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:


The highest speed is at 0°, 4.8 km/h or according to the Excel formula, 0.0002083 h/m. This is my attempt to implement this in GEE in this code, based on Tyler Erickson's code.

Is this correct?

var slope_in_radians = slope.multiply(3.1415).divide(180);
var cost = (

(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):

enter image description here

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.

enter image description here

How can I get GEE to produce the same results as ArcGIS?

Here's the relevant part of Rees 2004 (I used equation 1).

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.