Section 7 Getting distance to water
Here we cover adding data related to landscape features: 1. Distance to the nearest water source 2. Temperature measured by LANDSAT
7.1 Load libraries
7.2 Load water features
We load water features from an OpenStreetMap (OpenStreetMap contributors 2017) dump accessed in mid 2018.
# load rivers, or linear water features
rivers = st_read("data/river_crop/kruger_rivers_cropped.shp")
# load waterholes or point features
wh = st_read("data/waterholes/")
# read the extent of elephant data
ext = st_read("data/ele_ext")
# filter waterholes by the extent
wh = filter(wh, CURRENT=="Open") %>%
st_crop(ext) %>%
st_union()
7.3 Load elephant data
7.4 Add distance to water by season
# add distance to rivers data
data = mutate(data,
distr = distr_seasonal[["distr"]],
distr_s = distr_seasonal[["distr_seasonal"]],
distwh = distwh)
# calculate mindw, the minimum distance to water
data = data %>%
mutate(mindw = case_when(
season =="dry"~ifelse(distr_s < distwh, distr_s, distwh),
season == "wet"~ifelse(distr < distwh, distr, distwh),
T~as.double(NA)
))
7.5 Write data to file
Farr, Tom G., Paul A. Rosen, Edward Caro, Robert Crippen, Riley Duren, Scott Hensley, Michael Kobrick, et al. 2007. “The Shuttle Radar Topography Mission.” Reviews of Geophysics 45 (2). https://doi.org/10.1029/2005RG000183.
Gorelick, Noel, Matt Hancher, Mike Dixon, Simon Ilyushchenko, David Thau, and Rebecca Moore. 2017. “Google Earth Engine: Planetary-Scale Geospatial Analysis for Everyone.” Remote Sensing of Environment 202: 18–27. https://doi.org/10.1016/j.rse.2017.06.031.
OpenStreetMap contributors. 2017. Planet Dump Retrieved from https://planet.osm.org.
Schmidt, Gail, Calli B. Jenkerson, Jeffrey Masek, Eric Vermote, and Feng Gao. 2013. “Landsat Ecosystem Disturbance Adaptive Processing System (LEDAPS) Algorithm Description.” USGS Numbered Series 2013-1057. Open-File Report. Reston, VA: U.S. Geological Survey. http://pubs.er.usgs.gov/publication/ofr20131057.
References
OpenStreetMap contributors. 2017. Planet Dump Retrieved from https://planet.osm.org.