Open lzdoesdata opened 5 years ago
the process for this includes:
some official guidelines from nps.org: "Our trails difficulty ratings are generally based on trail condition, steepness of grades, gain and loss of elevation, and the amount and kinds of natural barriers that must be traversed. These ratings mean different things depending on if the trail was designed for foot use, for horse use, for bike use or for wheelchair use."
So the code for computing length is similar to what we completed in lab 16:
library(sf) macleish_layers %>% pluck("trails") %>% st_length()
Then create a new object:
trails <- macleish_layers %>% pluck("trails") %>% mutate(computed_length = st_length(geometry))
This new data frame creates a minor problem: the names of the trails here are different than the ones on the map provided by MacLeish. Some of the trails are repeated twice, with different lengths. I don't know why this is, but I'm thinking we should estimate which trail in "trails" corresponds with the same trail on the map.
Also @lzdoesdata you talked about converting meters to miles: to do that we have to get rid of the [m] that appears next to the values in the computed_length column. Here's the code for that:
trails$computed_length <- as.numeric(str_extract(trails$computed_length, "[0-9]+"))
I'm unclear how we are going to actually rate the difficulty of each trail. There are several different formulas to measure it here. I think the Shenandoah system might be the most straightforward.
To summarize their method:
Equation: Elevation Gain x 2 x distance (in miles). The product's square root is the numerical rating.
Easiest Numerical Rating: less than 50
Moderate Numerical Rating: 50-100
Moderately Strenuous Numerical Rating: 100 –150
Strenuous Numerical Rating: 150-200
I doubt we will see any trails that are more than "Moderately Strenuous".
trails$computed_length <- as.numeric(str_extract(trails$computed_length, "[0-9]+")) this code is wrong dot use it !
Now that we have plotted our desired shape files (landmarks, trails, boundary, contour), we need to devise metrics for determining what attributes make something "difficult". Here's some ideas:
let me know what you guys think!