Package 'addNlcdData'

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

Help Index


download all chunks needed for nlcd multiple cell numbers ahead of time

Description

download all chunks needed for nlcd multiple cell numbers ahead of time

Usage

download_nlcd_chunks(nlcd_cell_numbers)

Arguments

nlcd_cell_numbers

vector of nlcd cell numbers

Value

downloaded fst files in nlcd_fst folder in working directory

Examples

if (FALSE) {
nlcd_cell_numbers <- c(7814606790, 7814606790, 7756256174)

download_nlcd_chunks(nlcd_cell_numbers)
}

get NLCD cell numbers for given lat and lon

Description

get NLCD cell numbers for given lat and lon

Usage

get_nlcd_cell_numbers_points(point_data)

Arguments

point_data

data.frame with columns 'lat' and 'lon'

Value

a data.frame identical to the input data.frame but with appended NLCD cell numbers

Examples

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

Description

get NLCD data for NLCD cells

Usage

get_nlcd_data(raw_data, product = c("nlcd", "impervious",
  "imperviousdescriptor"), year = c(2001, 2006, 2011, 2016))

Arguments

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)

Value

a data.frame identical to the input data.frame but with appended NLCD values (and in long format)

Examples

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

Description

get NLCD data for specified buffer radius around point data

Usage

get_nlcd_data_point_buffer(point_data, buffer_m)

Arguments

point_data

data.frame with columns 'lat' and 'lon'

buffer_m

desired buffer radius in meters

Value

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.

Examples

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

Description

get NLCD data for polygons

Usage

get_nlcd_data_polygons(polygon_data)

Arguments

polygon_data

an sf data.frame containing polygons for which data from nlcd cells will be averaged

Value

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.