Skip to content

Commit 020e0dc

Browse files
committed
Add s2 note, close #748
1 parent c6413bb commit 020e0dc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

02-spatial-data.Rmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,14 @@ Turn it on again with the following command.
828828
sf_use_s2(TRUE)
829829
```
830830

831+
```{block2 09-gis-2, type="rmdnote"}
832+
Although the **sf**'s used of S2 makes sense in many cases, in some cases there are good reasons for turning S2 off for the duration of an R session or even for an entire project.
833+
As documented in issue [1771](https://github.com/r-spatial/sf/issues/1771) in **sf**'s GitHub repo, the default behavior can make code that would work with S2 turned off (and with older versions of **sf**) fail.
834+
These edge cases include operations on polygons that are not valid according to S2's stricter definition.
835+
If you see error message such as `#> Error in s2_geography_from_wkb ...` it may be worth trying the command that generated the error message again, after turning off S2.
836+
To turn off S2 for the entirety of a project you can create a file called .Rprofile in the root directory (the main folder) of your project containing the command `sf::sf_use_s2(FALSE)`.
837+
```
838+
831839
## Raster data
832840

833841
The spatial raster data model represents the world with the continuous grid of cells (often also called pixels; Figure \@ref(fig:raster-intro-plot):A).

0 commit comments

Comments
 (0)