-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
68 lines (51 loc) · 1.86 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
---
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%"
)
```
<br>
# demsrc
<!-- badges: start -->
[![R-CMD-check](https://github.com/Permian-Global-Research/demsrc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Permian-Global-Research/demsrc/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/Permian-Global-Research/demsrc/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Permian-Global-Research/demsrc?branch=main)
<!-- badges: end -->
The goal of demsrc is to return the remote url sources for global DEM products.
For now, the only main function is `mpc_dtm_src` which accesses the collections
via the [Microsoft Planetary Computer STAC catalog](https://planetarycomputer.microsoft.com/catalog)
using the [{rstac} package](https://brazil-data-cube.github.io/rstac/)
## Installation
You can install the development version of demsrc from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("Permian-Global-Research/demsrc")
```
## Example
Here we load a few packages...
```{r pkg-load, message=FALSE, warning=FALSE}
library(demsrc)
library(terra)
library(sf)
```
And now we request the ALOS DEM urls for the Mount Hood area in Oregon using
the bounding box coordinates.
```{r Mt-Hood-example}
(mh <- mpc_dtm_src(c(-121.772, 45.321, -121.611, 45.419),
collection = "alos-dem"
))
plot(rast(mh))
```
And now to get the COP30 DEM urls for the North Carolina dataset, using and
sf object as the area of interest.
```{r nc-example}
nc_sf <- system.file("gpkg", "nc.gpkg", package = "sf") |>
read_sf()
# show the first 3 urls:
mpc_dtm_src(nc_sf, collection = "cop-dem-glo-30")[1:3]
```