-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
60 lines (43 loc) · 1.47 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
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- 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%"
)
```
# earthcircle
<!-- badges: start -->
<!-- badges: end -->
The goal of earthcircle is to ...
## Installation
You can install the development version of earthcircle from [Github](https://github.com/hypertidy/earthcircle) with:
``` r
pak::pak("hypertidy/earthcircle")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r earthcircle}
library(earthcircle)
pts <- expand.grid(seq(-170, 170 ,length.out = 18), seq(-75, 75, length.out = 9))
eap <- earthcircle(pts, scale = 500500)
plot(reproj::reproj_xy(eap, "+proj=merc", source = "OGC:CRS84"), type = "l", asp = 1)
```
Minimal compare of the tissot ellipses with earth circle (most online stuff confuses these).
```{r example}
pts <- expand.grid(seq(0, 120 ,length.out = 9), seq(-70, 0, length.out = 6))
eap <- earthcircle(pts, scale = 500500)
library(tissot)
ti <- tissot(pts, proj.out = "+proj=robin", proj.in = "+proj=longlat")
ii <- indicatrix(ti, scale = 500500/2)
plot(ii, xlim = c(5e6, 1e7), ylim = c(-8e6, 0), asp = 1)
lines(earthcircle:::.prj(eap, "+proj=robin"), col ="firebrick")
m <- reproj::reproj_xy(do.call(cbind, maps::map(plot = F)[1:2]), "+proj=robin", source = "OGC:CRS84")
lines(m)
```