Buffer distances (in miles) extend from the perimeter of park or trail units. For trails, the buffer distance is effectively a radius. For example, a one-mile buffer on each side of a trail would mean a two-mile diameter path centered on the trail.
library(tidyverse) library(sf) park <- regionalparks.acs::park_trail_geog_LONG[c(15),0] %>% st_transform(3857) buf025 <- park %>% st_buffer(dist = 1609.34 * .25) buf05 <- park %>% st_buffer(dist = 1609.34 * .5) trail <- regionalparks.acs::park_trail_geog_LONG[c(109),0] %>% st_transform(3857) tbuf025 <- trail %>% st_buffer(dist = 1609.34 * .25) tbuf05 <- trail %>% st_buffer(dist = 1609.34 * .5)
Example of two different buffer distances (dark grey, light grey) around a park polygon (green):
parkbuffer = ggplot() + geom_sf(data = buf05, fill = "grey90") + geom_sf(data = buf025, fill = "grey70") + geom_sf(data = park, fill = "#78A22F") + theme_void() # parkbuffer
Example of two different buffer distances (dark grey, light grey) around a trail segment (green):
trailbuffer = ggplot() + geom_sf(data = tbuf05, fill = "grey90") + geom_sf(data = tbuf025, fill = "grey70") + geom_sf(data = trail, color = "#78A22F", size=4) + theme_void() # trailbuffer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.