-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
80 lines (59 loc) · 2.37 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
warning = FALSE
)
gpkg = '/Users/mikejohnson/hydrofabric/conus_nextgen.gpkg'
```
# hfsubsetR <a href="https://github.com/lynker-spatial/hfsubsetR"><img src="man/figures/logo.png" align="right" width="25%"/></a>
<!-- badges: start -->
[![R CMD Check](https://github.com/lynker-spatial/hfsubsetR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lynker-spatial/hfsubsetR/actions/workflows/R-CMD-check.yaml)
[![Test coverage](https://github.com/lynker-spatial/hfsubsetR/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/lynker-spatial/hfsubsetR/actions/workflows/test-coverage.yaml)
[![Dependencies](https://img.shields.io/badge/dependencies-8/71-orange?style=flat)](#)
[![License: GPL (>= 3)](https://img.shields.io/badge/License-GPL%20%28%3E%3D%203%29-blue.svg)](https://choosealicense.com/licenses/gpl-3.0/)
<!-- badges: end -->
The goal of `hfsubsetR` is to extract hydrofabric subsets from cloud or local archives built in `lynker-spatial`.
## Installation
You can install the development version of `hfsubsetR` from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("lynker-spatial/hfsubsetR")
```
```{r}
library(hfsubsetR)
```
## Basic Use
### From local file
We can download a version (default = '2.2') hydrofabric (default = 'nextgen') for any domain (default = 'conus') using `get_hydrofabric`.
```{r, eval = FALSE}
gpkg <- './conus_nextgen.gpkg'
get_hydrofabric(outfile = gpkg)
```
From that, we can extract data for a VPU:
```{r, eval = FALSE}
get_vpu_fabric(gpkg,
vpuid = "01",
outfile = './01_nextgen.gpkg')
```
Or, we can extract a subset based on an input identifier (one of `id`, `comid`, `hl_uri`, `poi_id`, `nldi_feature`, `xy`):
```{r}
subset_fabric <- get_subset(gpkg = gpkg, comid = 101)
```
```{r, echo = FALSE}
{
plot(subset_fabric$divides$geom, col = "gray90")
plot(subset_fabric$flowpaths$geom, add = TRUE, col = "blue")
plot(subset_fabric$nexus, add = TRUE, col = "red", pch = 16)
}
```
### From Remote
Coming soon...
### Questions?
Please reach out via an issue or PR if you have comments, concerns, or questions!