You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The s2 R package provides bindings to Google's [S2Geometry](https://s2geometry.io) library. The package exposes an API similar to Google's [BigQuery Geography API](https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions), whose functions also operate on spherical geometries. Package [sf](https://cran.r-project.org/web/packages/sf/index.html) uses this package by default for nearly all its geometrical operations on objects with ellipsoidal (unprojected) coordinates; in cases where it doesn't, such as `st_relate()`, it emits a warning.
14
+
The s2 R package provides bindings to Google’s
15
+
[S2Geometry](https://s2geometry.io) library. The package exposes an API
The s2 package provides geometry transformers and predicates similar to those found in [GEOS](https://trac.osgeo.org/geos/), except instead of assuming a planar geometry, s2's functions work in latitude and longitude and assume a spherical geometry:
41
-
46
+
The s2 package provides geometry transformers and predicates similar to
47
+
those found in [GEOS](https://trac.osgeo.org/geos/), except instead of
48
+
assuming a planar geometry, s2’s functions work in latitude and
49
+
longitude and assume a spherical geometry:
42
50
43
-
```r
51
+
```r
44
52
library(s2)
45
53
46
54
s2_contains(
@@ -52,10 +60,12 @@ s2_contains(
52
60
#> [1] TRUE
53
61
```
54
62
55
-
The [sf package](https://r-spatial.github.io/sf/) uses s2 for geographic coordinates with `sf::sf_use_s2(TRUE)`, and will become the default after sf version 1.0.0. The sf package also supports creating s2 vectors using `as_s2_geography()`:
56
-
63
+
The [sf package](https://r-spatial.github.io/sf/) uses s2 for geographic
64
+
coordinates with `sf::sf_use_s2(TRUE)`, and will become the default
65
+
after sf version 1.0.0. The sf package also supports creating s2 vectors
66
+
using `as_s2_geography()`:
57
67
58
-
```r
68
+
```r
59
69
library(dplyr)
60
70
library(sf)
61
71
@@ -83,8 +93,7 @@ nc_s2
83
93
84
94
Use accessors to extract information about geometries:
0 commit comments