knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

LAGOSUSgis

Lifecycle: experimental CRAN status DOI

Extra functions to interact with the GIS module of LAGOSUS.

Features

Installation

remotes::install_github("cont-limno/LAGOSUSgis")

Usage

library(LAGOSUSgis)

Download data

# lagosusgis_get()

Until data is posted publicly, place the LAGOSUSgis geodatabase file in the location returned by lagosusgis_path()

List available GIS layers

library(sf)
sf::st_layers(LAGOSUSgis::lagosusgis_path())
library(details)
ly <- sf::st_layers(LAGOSUSgis:::lagosusgis_path())
details(
knitr::kable(data.frame(ly[c("name", "driver", "features", "fields")])), 
summary = "layers")

Query a lake polygon

res_lake <- query_lake_poly(34352)

Query from a specfic layer

res_iws  <- query_gis(layer = "ws", 
                      id_name = "lagoslakeid", ids = c(34352))
res_lake <- query_gis(layer = "LAGOS_US_All_Lakes_1ha", 
                      id_name = "lagoslakeid", ids = 34352)
res_pnt  <- query_gis(layer = "LAGOS_US_All_Lakes_1ha_POINTS", 
                      id_name = "lagoslakeid", ids = 34352)

Query a combined watershed and lake polygon

res <- query_wbd(lagoslakeid = c(7010))

Flexible queries using SQL statements

res <- query_gis_(query = "SELECT * FROM ws WHERE lagoslakeid IN ('7010')")
res <- query_gis_(query = paste0("SELECT * FROM LAGOS_US_All_Lakes_1ha_points WHERE lake_centroidstate LIKE '", "RI", "' AND lake_totalarea_ha > 4"))

References

Soranno P., K. Cheruvelil. 2017. LAGOS-NE-GIS v1.0: A module for LAGOS-NE, a multi-scaled geospatial and temporal database of lake ecological context and water quality for thousands of U.S. Lakes: 2013-1925. Environmental Data Initiative. http://dx.doi.org/10.6073/pasta/fb4f5687339bec467ce0ed1ea0b5f0ca. Dataset accessed 9/26/2017.



cont-limno/LAGOSUSgis documentation built on Aug. 4, 2021, 5:14 p.m.