-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
61 lines (39 loc) · 1.58 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
---
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%"
)
```
# isoraster
<!-- badges: start -->
[![R-CMD-check](https://github.com/hypertidy/isoraster/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/hypertidy/isoraster/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of isoraster is to create contour lines and contour polygons from rasters.
The R terra package is used as a foundation. The R isoband package is the engine, sf is used as an intermediate format internally.
## Installation
You can install the development version of isoraster like so:
``` r
remotes::install_github("hypertidy/isoraster")
```
## Example
This is a basic example.
```{r example}
library(isoraster)
plot(isoband_terra(rast(volcano)))
plot(isoline_terra(rast(volcano), seq(100, 170, by = 5)))
plot(isoband_terra(rast(volcano), c(100, 110, 120), c(110, 120, 130)))
```
Note that the lines are nice and smooth, because the underlying algorithm is marching squares in {isoband}, equivalent to R's 'contour()'.
```{r decimated}
dr <- aggregate(rast(volcano), 4)
plot(dr)
plot(isoband_terra(dr, c(120, 130, 160), c(130, 160, 170)), add = TRUE)
```
## Code of Conduct
Please note that the isoraster 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.