Title: | Add National Landcover Database Variables to Your Data |
---|---|
Description: | Add National Landcover Database (NLCD) Variables to your data by downloading only chunks of NLCD data from the internet needed for your aread of interest. NLCD variables include imperviousness, greenness, and impervious descriptor (road type) and are based on a 30 m x 30 m grid. NLCD variables can be added for point data (lat/lon), polygon data (as an sf object), or point data with a specified buffer radius. |
Authors: | Erika Rasnick [aut, cre] |
Maintainer: | Erika Rasnick <[email protected]> |
License: | GPL-3 |
Version: | 0.0.5 |
Built: | 2024-10-25 02:44:58 UTC |
Source: | https://github.com/geomarker-io/addNlcdData |
download all chunks needed for nlcd multiple cell numbers ahead of time
download_nlcd_chunks(nlcd_cell_numbers)
download_nlcd_chunks(nlcd_cell_numbers)
nlcd_cell_numbers |
vector of nlcd cell numbers |
downloaded fst files in nlcd_fst folder in working directory
if (FALSE) { nlcd_cell_numbers <- c(7814606790, 7814606790, 7756256174) download_nlcd_chunks(nlcd_cell_numbers) }
if (FALSE) { nlcd_cell_numbers <- c(7814606790, 7814606790, 7756256174) download_nlcd_chunks(nlcd_cell_numbers) }
get NLCD cell numbers for given lat and lon
get_nlcd_cell_numbers_points(point_data)
get_nlcd_cell_numbers_points(point_data)
point_data |
data.frame with columns 'lat' and 'lon' |
a data.frame identical to the input data.frame but with appended NLCD cell numbers
if (FALSE) { point_data <- data.frame( id = c('1a', '2b', '3c'), lat = c(39.19674, 39.19674, 39.28765), lon = c(-84.582601, -84.582601, -84.510173) ) get_nlcd_cell_numbers_points(point_data) }
if (FALSE) { point_data <- data.frame( id = c('1a', '2b', '3c'), lat = c(39.19674, 39.19674, 39.28765), lon = c(-84.582601, -84.582601, -84.510173) ) get_nlcd_cell_numbers_points(point_data) }
get NLCD data for NLCD cells
get_nlcd_data(raw_data, product = c("nlcd", "impervious", "imperviousdescriptor"), year = c(2001, 2006, 2011, 2016))
get_nlcd_data(raw_data, product = c("nlcd", "impervious", "imperviousdescriptor"), year = c(2001, 2006, 2011, 2016))
raw_data |
data.frame with column 'nlcd_cell' |
product |
a character string of desired nlcd variables; a subset of c("nlcd", "impervious", "imperviousdescriptor") |
year |
a numeric vector of desired nlcd years; a subset of c(2001, 2006, 2011, 2016) |
a data.frame identical to the input data.frame but with appended NLCD values (and in long format)
if (FALSE) { d <- data.frame( id = c('1a', '2b', '3c'), nlcd_cell = c(7814606790, 7814606790, 7756256174) ) get_nlcd_data(d, product = c("nlcd", "impervious"), year = c(2011, 2016)) }
if (FALSE) { d <- data.frame( id = c('1a', '2b', '3c'), nlcd_cell = c(7814606790, 7814606790, 7756256174) ) get_nlcd_data(d, product = c("nlcd", "impervious"), year = c(2011, 2016)) }
get NLCD data for specified buffer radius around point data
get_nlcd_data_point_buffer(point_data, buffer_m)
get_nlcd_data_point_buffer(point_data, buffer_m)
point_data |
data.frame with columns 'lat' and 'lon' |
buffer_m |
desired buffer radius in meters |
a data.frame identical to the input data.frame but with appended percentage NLCD values (and in long format) all available products and years will be returned.
if (FALSE) { point_data <- data.frame( id = c('1a', '2b', '3c'), lat = c(39.19674, 39.19674, 39.28765), lon = c(-84.582601, -84.582601, -84.510173) ) get_nlcd_data_polygons(point_data, buffer_m = 400) }
if (FALSE) { point_data <- data.frame( id = c('1a', '2b', '3c'), lat = c(39.19674, 39.19674, 39.28765), lon = c(-84.582601, -84.582601, -84.510173) ) get_nlcd_data_polygons(point_data, buffer_m = 400) }
get NLCD data for polygons
get_nlcd_data_polygons(polygon_data)
get_nlcd_data_polygons(polygon_data)
polygon_data |
an sf data.frame containing polygons for which data from nlcd cells will be averaged |
a data.frame identical to the input data.frame but with appended percentage NLCD values (and in long format) all available products and years will be returned.