Calculating accumulated walking pace from starting location outwards using R?Working out travel time from...

Computing the volume of a simplex-like object with constraints

Genitives like "axeos"

Is divide-by-zero a security vulnerability?

Convert an array of objects to array of the objects' values

How spaceships determine each other's mass in space?

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

Can a Mimic (container form) actually hold loot?

Why would the IRS ask for birth certificates or even audit a small tax return?

Can inspiration allow the Rogue to make a Sneak Attack?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

How can friction do no work in case of pure rolling?

When to use the term transposed instead of modulation?

Practical reasons to have both a large police force and bounty hunting network?

How to chmod files that have a specific set of permissions

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Why can't we use freedom of speech and expression to incite people to rebel against government in India?

Why is there an extra space when I type "ls" on the Desktop?

Why do we call complex numbers “numbers” but we don’t consider 2 vectors numbers?

Align equations with text before one of them

Error in TransformedField

What can I do if someone tampers with my SSH public key?

Can you run a ground wire from stove directly to ground pole in the ground

Paper published similar to PhD thesis

PTIJ: Mouthful of Mitzvos



Calculating accumulated walking pace from starting location outwards using R?


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?













3















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



enter image description here



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.










share|improve this question





























    3















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



    enter image description here



    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.










    share|improve this question



























      3












      3








      3








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



      enter image description here



      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.










      share|improve this question
















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



      enter image description here



      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 20 '18 at 10:32









      PolyGeo

      53.6k1781242




      53.6k1781242










      asked Apr 19 '18 at 15:10









      NewAtGisNewAtGis

      910821




      910821






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.





          share























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            0














            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.





            share




























              0














              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.





              share


























                0












                0








                0







                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.





                share













                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.






                share











                share


                share










                answered 5 mins ago









                MoxMox

                712411




                712411






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

                    Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                    Энтрерриос (город) Содержание История | Географическое...