Calculating accumulated walking pace from starting location outwards using R? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Working out travel time from gdistance's conductance values in R?Integrating use of surface distance when calculating cumulative cost-surface based on walking pace?R least cost pathBuilding raster indicating whether slope is positive or negative moving from start location?how to calculate cumulative cost of movement, accounting for wind direction, in R?Accumulated cost surface (Tobler's hiking function) ignoring slope using R gdistance?Working out travel time from gdistance's conductance values in R?Understanding the values from transition layers produced by the R package `gdistance`Integrating use of surface distance when calculating cumulative cost-surface based on walking pace?Tobler's hiking function: resulting walking speed in KmH or m/s?How can I estimate a Least Cost Path in Google Earth Engine?Implementing travel cost equation in Google Earth Engine with image math?
How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?
Variable with quotation marks "$()"
How to handle characters who are more educated than the author?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Presidential Pardon
Can we generate random numbers using irrational numbers like π and e?
Match Roman Numerals
Are spiders unable to hurt humans, especially very small spiders?
Can a flute soloist sit?
Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?
Do ℕ, mathbbN, BbbN, symbbN effectively differ, and is there a "canonical" specification of the naturals?
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
My body leaves; my core can stay
"is" operation returns false even though two objects have same id
Why are PDP-7-style microprogrammed instructions out of vogue?
Identify 80s or 90s comics with ripped creatures (not dwarves)
Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?
What happens to a Warlock's expended Spell Slots when they gain a Level?
How do I design a circuit to convert a 100 mV and 50 Hz sine wave to a square wave?
Word for: a synonym with a positive connotation?
Windows 10: How to Lock (not sleep) laptop on lid close?
Why doesn't a hydraulic lever violate conservation of energy?
US Healthcare consultation for visitors
Calculating accumulated walking pace from starting location outwards using R?
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Working out travel time from gdistance's conductance values in R?Integrating use of surface distance when calculating cumulative cost-surface based on walking pace?R least cost pathBuilding raster indicating whether slope is positive or negative moving from start location?how to calculate cumulative cost of movement, accounting for wind direction, in R?Accumulated cost surface (Tobler's hiking function) ignoring slope using R gdistance?Working out travel time from gdistance's conductance values in R?Understanding the values from transition layers produced by the R package `gdistance`Integrating use of surface distance when calculating cumulative cost-surface based on walking pace?Tobler's hiking function: resulting walking speed in KmH or m/s?How can I estimate a Least Cost Path in Google Earth Engine?Implementing travel cost equation in Google Earth Engine with image math?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Goal
In R, I would like to calculate an accumulated cost surface around a starting location, with the cost representing the time (say, hours) to walk from the location outwards in all directions (say, 8 directions in raster's terms). The walking time (pace) is devised via the Tobler's hiking function (https://en.wikipedia.org/wiki/Tobler%27s_hiking_function).
I have indeed used ArcGIS to achieve that in the past, using the 'Path Distance' tool (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/how-the-path-distance-tools-work.htm), which implements the method devised by Cixiang Zhan, Sudhakar Menon, Peng Gao (https://link.springer.com/chapter/10.1007/3-540-57207-4_29). I would like to reproduce something similar in R.
Earlier threads
I have made a search in this Forum, but at the best of my knowledge the issue has been always tackled from an ArcGIS perspective.
Issue
In theory, the implementation of the methodology is simple, but I have hard time to devise the correct workflow in R. Also, I do believe that the gdistance
package is the key to the calculation of an accumulated cost surface, but I cannot wrap my head around how to properly use the transition()
function.
What I did so far
# Define the Tober's function for speed in kmh
tobler.kmh <- function(x) 6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))
# calculate the slope from an input DTM
SLOPE <- raster::terrain(dtm, opt='slope', unit='degrees', neighbors=8)
# calculate the speed in Kmh
v.kmh <- calc(SLOPE, tobler.kmh)
# time in h to cross 1 km (p stands for 'pace')
p.hkm <- 1/v.kmh
# express the speed in meters per hour
v.mh <- v.kmh * 1000
# time in hours to cross 1 m
p.hm <- 1 / v.mh
Where I am stuck
Now, with the ultimate goal to devise isochrones, I think I would need to accumulate the pace (in hours per meters = p.hm) outwards from a given location. I guess that the gdistance's accCost()
function would make the trick, but I cannot understand how to tackle the intermediate step that entails creating a transition matrix via the transition()
function. The latter (at the best of my understanding) would allow to define a traversing cost other than distance in which one incurrs when moving from one cell to an adjacent cell.
I do not know: (a) if the above formula to calculate the pace (in hours per meters) has to be somehow implemented withing the transition()
function; (b) if I am approacing the whole issue from the wrong perspective.
raster r cost-surface
add a comment |
Goal
In R, I would like to calculate an accumulated cost surface around a starting location, with the cost representing the time (say, hours) to walk from the location outwards in all directions (say, 8 directions in raster's terms). The walking time (pace) is devised via the Tobler's hiking function (https://en.wikipedia.org/wiki/Tobler%27s_hiking_function).
I have indeed used ArcGIS to achieve that in the past, using the 'Path Distance' tool (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/how-the-path-distance-tools-work.htm), which implements the method devised by Cixiang Zhan, Sudhakar Menon, Peng Gao (https://link.springer.com/chapter/10.1007/3-540-57207-4_29). I would like to reproduce something similar in R.
Earlier threads
I have made a search in this Forum, but at the best of my knowledge the issue has been always tackled from an ArcGIS perspective.
Issue
In theory, the implementation of the methodology is simple, but I have hard time to devise the correct workflow in R. Also, I do believe that the gdistance
package is the key to the calculation of an accumulated cost surface, but I cannot wrap my head around how to properly use the transition()
function.
What I did so far
# Define the Tober's function for speed in kmh
tobler.kmh <- function(x) 6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))
# calculate the slope from an input DTM
SLOPE <- raster::terrain(dtm, opt='slope', unit='degrees', neighbors=8)
# calculate the speed in Kmh
v.kmh <- calc(SLOPE, tobler.kmh)
# time in h to cross 1 km (p stands for 'pace')
p.hkm <- 1/v.kmh
# express the speed in meters per hour
v.mh <- v.kmh * 1000
# time in hours to cross 1 m
p.hm <- 1 / v.mh
Where I am stuck
Now, with the ultimate goal to devise isochrones, I think I would need to accumulate the pace (in hours per meters = p.hm) outwards from a given location. I guess that the gdistance's accCost()
function would make the trick, but I cannot understand how to tackle the intermediate step that entails creating a transition matrix via the transition()
function. The latter (at the best of my understanding) would allow to define a traversing cost other than distance in which one incurrs when moving from one cell to an adjacent cell.
I do not know: (a) if the above formula to calculate the pace (in hours per meters) has to be somehow implemented withing the transition()
function; (b) if I am approacing the whole issue from the wrong perspective.
raster r cost-surface
add a comment |
Goal
In R, I would like to calculate an accumulated cost surface around a starting location, with the cost representing the time (say, hours) to walk from the location outwards in all directions (say, 8 directions in raster's terms). The walking time (pace) is devised via the Tobler's hiking function (https://en.wikipedia.org/wiki/Tobler%27s_hiking_function).
I have indeed used ArcGIS to achieve that in the past, using the 'Path Distance' tool (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/how-the-path-distance-tools-work.htm), which implements the method devised by Cixiang Zhan, Sudhakar Menon, Peng Gao (https://link.springer.com/chapter/10.1007/3-540-57207-4_29). I would like to reproduce something similar in R.
Earlier threads
I have made a search in this Forum, but at the best of my knowledge the issue has been always tackled from an ArcGIS perspective.
Issue
In theory, the implementation of the methodology is simple, but I have hard time to devise the correct workflow in R. Also, I do believe that the gdistance
package is the key to the calculation of an accumulated cost surface, but I cannot wrap my head around how to properly use the transition()
function.
What I did so far
# Define the Tober's function for speed in kmh
tobler.kmh <- function(x) 6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))
# calculate the slope from an input DTM
SLOPE <- raster::terrain(dtm, opt='slope', unit='degrees', neighbors=8)
# calculate the speed in Kmh
v.kmh <- calc(SLOPE, tobler.kmh)
# time in h to cross 1 km (p stands for 'pace')
p.hkm <- 1/v.kmh
# express the speed in meters per hour
v.mh <- v.kmh * 1000
# time in hours to cross 1 m
p.hm <- 1 / v.mh
Where I am stuck
Now, with the ultimate goal to devise isochrones, I think I would need to accumulate the pace (in hours per meters = p.hm) outwards from a given location. I guess that the gdistance's accCost()
function would make the trick, but I cannot understand how to tackle the intermediate step that entails creating a transition matrix via the transition()
function. The latter (at the best of my understanding) would allow to define a traversing cost other than distance in which one incurrs when moving from one cell to an adjacent cell.
I do not know: (a) if the above formula to calculate the pace (in hours per meters) has to be somehow implemented withing the transition()
function; (b) if I am approacing the whole issue from the wrong perspective.
raster r cost-surface
Goal
In R, I would like to calculate an accumulated cost surface around a starting location, with the cost representing the time (say, hours) to walk from the location outwards in all directions (say, 8 directions in raster's terms). The walking time (pace) is devised via the Tobler's hiking function (https://en.wikipedia.org/wiki/Tobler%27s_hiking_function).
I have indeed used ArcGIS to achieve that in the past, using the 'Path Distance' tool (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/how-the-path-distance-tools-work.htm), which implements the method devised by Cixiang Zhan, Sudhakar Menon, Peng Gao (https://link.springer.com/chapter/10.1007/3-540-57207-4_29). I would like to reproduce something similar in R.
Earlier threads
I have made a search in this Forum, but at the best of my knowledge the issue has been always tackled from an ArcGIS perspective.
Issue
In theory, the implementation of the methodology is simple, but I have hard time to devise the correct workflow in R. Also, I do believe that the gdistance
package is the key to the calculation of an accumulated cost surface, but I cannot wrap my head around how to properly use the transition()
function.
What I did so far
# Define the Tober's function for speed in kmh
tobler.kmh <- function(x) 6 * exp(-3.5 * abs(tan(x*pi/180) + 0.05))
# calculate the slope from an input DTM
SLOPE <- raster::terrain(dtm, opt='slope', unit='degrees', neighbors=8)
# calculate the speed in Kmh
v.kmh <- calc(SLOPE, tobler.kmh)
# time in h to cross 1 km (p stands for 'pace')
p.hkm <- 1/v.kmh
# express the speed in meters per hour
v.mh <- v.kmh * 1000
# time in hours to cross 1 m
p.hm <- 1 / v.mh
Where I am stuck
Now, with the ultimate goal to devise isochrones, I think I would need to accumulate the pace (in hours per meters = p.hm) outwards from a given location. I guess that the gdistance's accCost()
function would make the trick, but I cannot understand how to tackle the intermediate step that entails creating a transition matrix via the transition()
function. The latter (at the best of my understanding) would allow to define a traversing cost other than distance in which one incurrs when moving from one cell to an adjacent cell.
I do not know: (a) if the above formula to calculate the pace (in hours per meters) has to be somehow implemented withing the transition()
function; (b) if I am approacing the whole issue from the wrong perspective.
raster r cost-surface
raster r cost-surface
edited Apr 20 '18 at 10:32
PolyGeo♦
53.9k1782246
53.9k1782246
asked Apr 19 '18 at 15:10
NewAtGisNewAtGis
925821
925821
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Look into the walkalytics or osrm packages. At the end of the day, what you want is an isochrone. Both the packages use the OpenStreetMap vector layer as a default. But it seems feasible to develop a custom 'profile' for OSRM, using something like the inverse of your walking velocity as the impedance measure of the links. I'm uncertain if raster inputs are permitted, or if you'd need to make it into a vector network first.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f280105%2fcalculating-accumulated-walking-pace-from-starting-location-outwards-using-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Look into the walkalytics or osrm packages. At the end of the day, what you want is an isochrone. Both the packages use the OpenStreetMap vector layer as a default. But it seems feasible to develop a custom 'profile' for OSRM, using something like the inverse of your walking velocity as the impedance measure of the links. I'm uncertain if raster inputs are permitted, or if you'd need to make it into a vector network first.
add a comment |
Look into the walkalytics or osrm packages. At the end of the day, what you want is an isochrone. Both the packages use the OpenStreetMap vector layer as a default. But it seems feasible to develop a custom 'profile' for OSRM, using something like the inverse of your walking velocity as the impedance measure of the links. I'm uncertain if raster inputs are permitted, or if you'd need to make it into a vector network first.
add a comment |
Look into the walkalytics or osrm packages. At the end of the day, what you want is an isochrone. Both the packages use the OpenStreetMap vector layer as a default. But it seems feasible to develop a custom 'profile' for OSRM, using something like the inverse of your walking velocity as the impedance measure of the links. I'm uncertain if raster inputs are permitted, or if you'd need to make it into a vector network first.
Look into the walkalytics or osrm packages. At the end of the day, what you want is an isochrone. Both the packages use the OpenStreetMap vector layer as a default. But it seems feasible to develop a custom 'profile' for OSRM, using something like the inverse of your walking velocity as the impedance measure of the links. I'm uncertain if raster inputs are permitted, or if you'd need to make it into a vector network first.
answered Mar 8 at 0:59
MoxMox
725412
725412
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f280105%2fcalculating-accumulated-walking-pace-from-starting-location-outwards-using-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown