-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
87 lines (60 loc) · 2.49 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# LAGOSNEgis
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) [![CRAN status](https://www.r-pkg.org/badges/version/LAGOSNEgis)](https://cran.r-project.org/package=LAGOSNEgis) [![Travis build status](https://travis-ci.org/cont-limno/LAGOSNEgis.svg?branch=master)](https://travis-ci.org/cont-limno/LAGOSNEgis) [![DOI](https://zenodo.org/badge/106293356.svg)](https://zenodo.org/badge/latestdoi/106293356)
Extra functions to interact with the GIS module of LAGOSNE.
## Features
* **Easy**: Convenience functions allow for straight-forward subsetting.
* **Fast**: Queries are optimized for speed to avoid loading the entirety of massive layers.
* **Flexible** : Custom queries can be constructed using `SQL` statements.
## Installation
```{r eval=FALSE}
remotes::install_github("cont-limno/LAGOSNEgis")
```
## Usage
```{r eval=FALSE}
library(LAGOSNEgis)
```
### Download data
```{r eval=FALSE}
lagosnegis_get()
```
### List available GIS layers
```{r eval=FALSE}
library(sf)
sf::st_layers(LAGOSNEgis:::lagosnegis_path())
```
```{r eval = FALSE, echo=FALSE}
ly <- sf::st_layers(LAGOSNEgis:::lagosnegis_path())
knitr::kable(data.frame(ly[c("name", "driver", "features", "fields")]))
```
### Query from a specfic layer
```{r eval=FALSE}
res_iws <- query_gis(layer = "IWS",
id_name = "lagoslakeid", ids = c(34352))
res_lake <- query_gis(layer = "LAGOS_NE_All_Lakes_4ha",
id_name = "lagoslakeid", ids = 34352)
res_pnt <- query_gis(layer = "LAGOS_NE_All_Lakes_4ha_POINTS",
id_name = "lagoslakeid", ids = 34352)
```
### Query a combined watershed and lake polygon
```{r eval=FALSE}
res <- query_wbd(lagoslakeid = c(7010))
```
### Flexible queries using `SQL` statements
```{r eval=FALSE}
res <- query_gis_(query = "SELECT * FROM IWS WHERE lagoslakeid IN ('7010');")
```
## 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.