Skip to content

Commit 8616ff9

Browse files
committed
Merge branch 'main' of github.com:r-spatial/sf
2 parents cb2c3bf + 4adc3df commit 8616ff9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

vignettes/sf7.Rmd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ coordinates, meaning that they are associated to points on a flat
5656
space, or to unprojected or _geographic_ coordinates, when they
5757
refer to angles (latitude, longitude) pointing to locations on a
5858
sphere (or ellipsoid). The flat space is also referred to as $R^2$,
59-
the sphere as $S^2$
59+
the sphere as $S^2$.
6060

6161
Package `sf` implements _simple features_, a standard for point,
6262
line, and polygon geometries where geometries are built from points
@@ -68,8 +68,8 @@ to $R^2$, the two-dimensional flat space.
6868

6969
Yet, more and more data are routinely served or exchanged using
7070
geographic coordinates. Using software that assumes an $R^2$, flat
71-
space may work for some problems, and although `sf` up to version 0.9-x
72-
had some functions in place for spherical/ellipsoidal computations
71+
space may work for some problems, and although `sf`
72+
has some functions in place for spherical/ellipsoidal computations
7373
(from package `lwgeom`, for computing area,
7474
length, distance, and for segmentizing), it has also happily warned
7575
the user that it is doing $R^2$, flat computations with such coordinates with messages like
@@ -252,6 +252,12 @@ sf_use_s2(TRUE)
252252

253253
# Measures
254254

255+
This section compares the differences in results between the `s2`
256+
and `lwgeom` (`sf_use_s2(FALSE)`) packages for calculating area,
257+
length and distance using geographic coordinates. Note that engaging
258+
the `GEOS` engine would require reprojection of the vector layer
259+
to the planar coordinate system (e.g. `EPGS:3857`).
260+
255261
## Area
256262
```{r eval=require("lwgeom", quietly = TRUE)}
257263
options(s2_oriented = FALSE) # correct orientation from here on
@@ -276,10 +282,9 @@ sf_use_s2(FALSE)
276282
l2 = st_length(nc_ls)
277283
plot(l1 , l2)
278284
abline(0, 1)
279-
summary((l1-l2)/l1)
285+
summary((l1 - l2)/l1)
280286
```
281287

282-
283288
## Distances
284289
```{r}
285290
sf_use_s2(TRUE)
@@ -288,7 +293,7 @@ sf_use_s2(FALSE)
288293
d2 = st_distance(nc, nc[1:10,])
289294
plot(as.vector(d1), as.vector(d2))
290295
abline(0, 1)
291-
summary(as.vector(d1)-as.vector(d2))
296+
summary(as.vector(d1) - as.vector(d2))
292297
```
293298

294299
# Predicates

0 commit comments

Comments
 (0)