I'm using Google Earth Engine to estimate walking time based on slope, using the Google tutorial and this example based on a DEM. My code actually runs, but I don't know what units the output raster is in.
To estimate the travel in time, I used an equation that gives me the hours needed to cross 30 m (the size of the pixel) for each degree of slope (Rees' update of Naismith's rule). For example, between 1 and 2 degrees, it takes 0.037 hours (2.2 minutes) to cross a 30 m pixel. According to the function reference, the cost should be to move across one pixel. I wonder if it accounts for diagonal or knight's moves. I used this code in GEE:
I calculated the values in Excel. The equation looks like this:
=(0.75+(0.09*ABS(TAN(RADIANS(slope in degrees))))+(14.6*(ABS(TAN(RADIANS(slope in degrees)))*EXP(2))))/3600*30
The cumulativeCost function does seem to work – the cost raster shows higher costs for higher slopes (contours every 500 units).
My main question: The resulting cumulativeCost raster has values up to 10,620. What are units are these? My input is in hours but there's no way it takes 10,620 hours to walk across 10 km (the maximum distance). I want the output raster to be in hours of travel time.
A minor issue: What is the syntax for inputting the cost equation directly into the code, instead of adding a line of code for each degree of slope?
A broader question: How can I use this cost raster to estimate a least cost path between two points? I would need to estimate direction of travel somehow. I can't find any related functions and very few applications – is this even possible in Google Earth Engine?