-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
57 lines (39 loc) · 1.55 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
---
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%"
)
```
# gdallocationinfo
<!-- badges: start -->
[](https://github.com/hypertidy/gdallocationinfo/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of gdallocationinfo is to look up values on a raster source.
Input is a character string to the GDAL readable source, and matrix of lon,lat.
## Installation
You can install the development version of gdallocationinfo like so:
``` r
devtools::install_github("hypertidy/gdallocationinfo")
```
## Example
This is a basic example, lookup GEBCO 2023 values on world cities:
```{r example}
library(gdallocationinfo)
#options(parallelly.fork.enable = TRUE, future.rng.onMisuse = "ignore")
#library(furrr); plan(multicore)
loc <- locationinfo("/vsicurl/https://gebco2023.s3.valeria.science/gebco_2023_land_cog.tif",
as.matrix(maps::world.cities[1:1000, c("long", "lat")]))
#plan(sequential)
str(loc)
range(loc)
maps::world.cities$name[which.max(loc)]
maps::world.cities$name[which.min(loc)]
```
## Code of Conduct
Please note that the gdallocationinfo project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.