2.3 Simple features (sf)
It is an open standard from Open Geospatial Consortium.
The standard has 18 geometry types and sf implement the 7 most import ones (points, lines, polygons, their multi-counterparts and geometry collection).
# TODO live
vignette(package = "sf")
vignette("sf1")
Simple features are stored in data frame with a special column (geom
/ geometry
).
To explore it we will use the world
data from spData
(?world
).
sf provides a method for the generic function plot
:
plot(world)
## Warning: plotting the first 9 out of 10 attributes; use max.plot = 10 to plot
## all
It can be manipulated like any other data.frame
.
summary(world["lifeExp"])
## lifeExp geom
## Min. :50.62 MULTIPOLYGON :177
## 1st Qu.:64.96 epsg:4326 : 0
## Median :72.87 +proj=long...: 0
## Mean :70.85
## 3rd Qu.:76.78
## Max. :83.59
## NA's :10
This object are easy to subset ([row, column]
).