Thursday 3 October 2019

raster - How can I estimate a Least Cost Path in Google Earth Engine?


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:


 cover.gt(1).and(cover.lt(2).multiply(0.0376700260935214).add(

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).


Cumulative cost raster with contour lines 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?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...