forked from paleolimbot/geos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
58 lines (43 loc) · 1.84 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
dpi = 300,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# geom
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
![R-CMD-check](https://github.com/paleolimbot/geom/workflows/R-CMD-check/badge.svg)
[![Codecov test coverage](https://codecov.io/gh/paleolimbot/geom/branch/master/graph/badge.svg)](https://codecov.io/gh/paleolimbot/geom?branch=master)
<!-- badges: end -->
The goal of geom is to provide [low-level access to the GEOS library](https://geos.osgeo.org/doxygen/geos__c_8h_source.html), supporting several common input/output formats to facilitate geoprocessing in R. This package tries to solve the "hard" problems associated with wrapping a C/C++ library, exposing an R API and a C++ API that can be used in dependency packages.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("paleolimbot/geom")
```
If you can load the package, you're good to go!
```{r example}
library(geom)
```
## Example
Create a line, buffer it, and plot!
```{r ex-plot}
line <- geo_wkt("LINESTRING (30 10, 10 30, 40 40)")
geo_plot(geos_buffer(line, width = 4), col = "grey90")
geo_plot_add(line)
```
## Philosophy
- Minimize conversion between in-memory formats
- Operate one feature at a time
- Use [vctrs](https://vctrs.r-lib.org/) where possible to make sure that geometry vectors can exist in a data frame.
- Clear size and type stability
- Don't consider spatial constraints (That's what [sf](https://r-spatial.github.io/sf) is so good at!)