📈 GH Trending Explorer 🎲 Surprise me

← all repos

r-spatial / sf

git clone https://github.com/r-spatial/sf.git v0.6-3 · 8y ago 🔥 on GitHub Trending today

Simple Features for R

+0
stars, 24h · #15,506
+~0
stars, 7 days · #16,004
+~0
stars, 30 days · #22,387
1.5k
★ total
305
forks · 65 open issues

Star history (as recorded here)

2026-10-20 · 1,451 ★ 2026-10-22 · 1,451 ★
LanguageR
License—
Created2015-11-06 (10y ago)
Last push1d ago
Watchers59
OwnerOrganization

Seen on GitHub Trending

  • 2026-10-22 — #5 daily in r
  • 2026-10-22 — #4 weekly in r
  • 2026-10-21 — #7 daily in r
  • 2026-10-20 — #7 daily in r

GitHub topics

Links

README excerpt
# Simple Features for R
A package that provides simple features access for R. 
Blogs, links • Cheatsheet • Installing
• Contributing • Acknowledgment • How to cite
Package sf:
* represents simple features as records in a `data.frame` or `tibble` with a geometry list-column
* represents natively in R all 17 simple feature types for all dimensions (XY, XYZ, XYM, XYZM)
* interfaces to GEOS for geometrical operations on projected coordinates, and (through R package s2) to s2geometry for geometrical operations on ellipsoidal coordinates
* interfaces to GDAL, supporting all driver options, `Date` and `POSIXct` and list-columns
* interfaces to PRØJ for coordinate reference system conversion and transformation
* uses well-known-binary serialisations written in C++/Rcpp for fast I/O with GDAL and GEOS 
* reads from and writes to spatial databases such as PostGIS using DBI
* is extended by 
 * lwgeom for selected liblwgeom/PostGIS functions
 * stars for raster data, and raster or vector data cubes (spatial time series)
 * sfnetworks for geospatial network data
(Illustration (c) 2018 by Allison Horst )
## Books, journal articles, blogs, presentations, vignettes, sp-sf wiki
* an open access R Journal article summarizes the package
* two books: Spatial Data Science: with applications in R, Geocomputation with R
* package vignettes: first, second, third, fourth, fifth, sixth, seventh
* blog posts: first, second, third, fourth
* the original R Consortium ISC proposal, the R Consortium blog post
* presentations: rstudio::conf 2018 (video), UseR! 2016
* wiki page describing sp-sf migration
## Cheatsheet
CC 4.0 BY Ryan Garnett 
## Installing
Install either from CRAN with:
 [code] 
This will install binary packages on Windows and MacOS, unless you configured R such that it tries to install source packages; in that case, see below.
Install development versions from GitHub with:
 [code] 
### Windows
Installing sf from source works under Windows when Rtools is installed.
### MacOS
MacOS users are strongly encouraged to install the `sf` binary packages from CRAN, unless they are familiar with compilers, linking, C++ source code, and homebrew. If you experience that R tries to install `sf` from source (or otherwise your install fails but you don't understand what is going on) try again by explicitly installing the binary, using
 [code] 
The remainder of this section is for those who understand what source installs mean, and imply.
Perhaps the easiest way of an install from source is to first install `gdal` using Homebrew. Recent versions of Homebrew include a full-featured up-to-date gdal formula, which installs `proj` and `gdal` at the same time:
 [code] 
Once gdal is installed, you may be able to install `sf` package from source in R. With the current version of `proj` on homebrew, installation requires additional configuration:
 [code] 
Or the development version:
 [code] 
Alternatively, these instructions explain how to install gdal using kyngchaos frameworks.
For M