Simple feature geometries
- Simple features (sf) are
things
that have a geometry, some time properties, and other attributes describing said things (e.g., labels).
- Everything is a sequence of points and lines! Hence simple.
The big seven sf
- point: single point geometry.
st_point()
, st_multipoint()
- linestring: two or more points connected by straight lines.
st_linestring()
, st_multilinestring()
- polygon: exterior ring with zero or more inner rings.
st_polygon()
, st_multipolygon()
- geometrycollection: list of geometries.
st_geometrycollection(list())
Valid geometries
- Linestrings do not self-intersect.
- Valid polygons and multi-polygons:
- polygon rings are closed
- polygon holes inside exterior ring
- polygon inner rings touch exterior ring in single points (not line)
- polygon ring does not repeat its own path
- multi-polygon: external ring touches other exterior ring in single points (not line)
- Invalid geometries can be repaired!