diff --git a/02-spatial-data.Rmd b/02-spatial-data.Rmd index e5acf1773..8ea7fa94d 100644 --- a/02-spatial-data.Rmd +++ b/02-spatial-data.Rmd @@ -828,6 +828,14 @@ Turn it on again with the following command. sf_use_s2(TRUE) ``` +```{block2 09-gis-2, type="rmdnote"} +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. +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. +These edge cases include operations on polygons that are not valid according to S2's stricter definition. +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. +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)`. +``` + ## Raster data 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).