Geographic Information Systems Asked by Steffan Clent Davies on August 4, 2020
I am trying to calculate the cost of walking a predefined path. The path can be a line or a number of points along that line. I have a DEM and derived it’s slope, which I will use as a friction map. I want to know the cost of getting from point A to point B using the line/points as a path, not the least cost path.
Using GRASS GIS, you could convert the path to a raster, then extract the slope values from all slope pixels along the path raster, and sum them up. So:
# Assuming a line vector named "path" and cost raster named "slope"
v.to.rast input=path output=path type=line use=val value=1
r.mapcalc "path_cost = if (path=1, slope, null())"
# The sum of the pixels will be the total cost based on slope of all pixels "under" the path
r.univar path_cost # Check value of "sum"
Answered by Micha on August 4, 2020
1 Asked on March 27, 2021 by satsuki
1 Asked on March 27, 2021
0 Asked on March 27, 2021 by blue_cat
1 Asked on March 26, 2021 by mrsalamikuchen
0 Asked on March 26, 2021
0 Asked on March 26, 2021 by tomas-hughes-hallett
0 Asked on March 26, 2021 by branddev
1 Asked on March 26, 2021 by konan-pruiksma
0 Asked on March 26, 2021 by thedrifter
1 Asked on March 26, 2021
0 Asked on March 26, 2021 by kerry
1 Asked on March 26, 2021 by xdsccc
google earth engine google earth engine javascript api landsat 8
4 Asked on March 26, 2021
0 Asked on March 26, 2021 by sdmarth
3 Asked on March 26, 2021 by raosaeedali
2 Asked on March 26, 2021 by squeezie
1 Asked on March 26, 2021 by freshop
arcgis server arcmap arcpy geoprocessing service python toolbox
Get help from others!
Recent Answers
© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP