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;








4















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






























    4















    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


























      4












      4








      4








      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.9k1782246




      53.9k1782246










      asked Apr 19 '18 at 15:10









      NewAtGisNewAtGis

      925821




      925821




















          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|improve this answer























            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|improve this answer



























              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|improve this answer

























                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|improve this answer













                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|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 0:59









                MoxMox

                725412




                725412



























                    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

                    Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

                    រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

                    Ромео және Джульетта Мазмұны Қысқаша сипаттамасы Кейіпкерлері Кино Дереккөздер Бағыттау мәзірі