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.

3.0.1 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())

3.0.2 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!