@@ -56,7 +56,7 @@ coordinates, meaning that they are associated to points on a flat
5656space, or to unprojected or _ geographic_ coordinates, when they
5757refer to angles (latitude, longitude) pointing to locations on a
5858sphere (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
6161Package ` sf ` implements _ simple features_ , a standard for point,
6262line, and polygon geometries where geometries are built from points
@@ -68,8 +68,8 @@ to $R^2$, the two-dimensional flat space.
6868
6969Yet, more and more data are routinely served or exchanged using
7070geographic 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,
7474length, distance, and for segmentizing), it has also happily warned
7575the 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)}
257263options(s2_oriented = FALSE) # correct orientation from here on
@@ -276,10 +282,9 @@ sf_use_s2(FALSE)
276282l2 = st_length(nc_ls)
277283plot(l1 , l2)
278284abline(0, 1)
279- summary((l1- l2)/l1)
285+ summary((l1 - l2)/l1)
280286```
281287
282-
283288## Distances
284289``` {r}
285290sf_use_s2(TRUE)
@@ -288,7 +293,7 @@ sf_use_s2(FALSE)
288293d2 = st_distance(nc, nc[1:10,])
289294plot(as.vector(d1), as.vector(d2))
290295abline(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