sf

Simple Features for R

https://github.com/r-spatial/sf

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    15 of 125 committers (12.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

gdal geos proj r r-package rstats spatial

Keywords from Contributors

book geospatial-data geo data-manipulation tidy-data rspatial grammar geography visualisation simple-features
Last synced: 6 months ago · JSON representation

Repository

Simple Features for R

Basic Info
Statistics
  • Stars: 1,385
  • Watchers: 62
  • Forks: 301
  • Open Issues: 81
  • Releases: 8
Topics
gdal geos proj r r-package rstats spatial
Created over 10 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.md

R-CMD-check tic-db Coverage Status License CRAN cran checks Downloads status <!-- badges: end -->

Simple Features for R

A package that provides simple features access for R.

Blogs, linksCheatsheetInstallingContributingAcknowledgmentHow 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

Cheatsheet

CC 4.0 BY Ryan Garnett

Installing

Install either from CRAN with: r install.packages("sf") 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: r library(remotes) install_github("r-spatial/sf")

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

r install.packages("sf", type = "binary")

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:

brew install pkg-config brew install gdal

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:

r install.packages("sf", type = "source", configure.args = "--with-proj-lib=$(brew --prefix)/lib/")

Or the development version:

r library(remotes) install_github("r-spatial/sf", configure.args = "--with-proj-lib=$(brew --prefix)/lib/")

Alternatively, these instructions explain how to install gdal using kyngchaos frameworks.

For Mac OS 11 Big Sur source install instruction, see here

Linux

For Unix-alikes, GDAL (>= 2.0.1), GEOS (>= 3.4.0) and Proj.4 (>= 4.8.0) are required.

Ubuntu

Dependencies for recent versions of Ubuntu (18.04 and later) are available in the official repositories; you can install them with:

sh sudo apt -y update && apt install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev libsqlite3-dev

However, to get more up-to-date versions of dependencies such as GDAL, GEOS and PROJ we recommend adding the ubuntugis-unstable PPA to the package repositories and installing them as follows:

sh sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt update sudo apt install libudunits2-dev libgdal-dev libgeos-dev libproj-dev libsqlite3-dev

Adding this PPA is required for installing sf on older versions of Ubuntu (e.g. Xenial).

Another option, for advanced users, is to install dependencies from source; see e.g. an older Travis config file for hints.

Fedora

The following command installs all required dependencies: sh sudo dnf install gdal-devel proj-devel geos-devel sqlite-devel udunits2-devel

Arch

Get gdal, proj, geos and podofo from the main repos, and udunits from the AUR:

pacman -S gdal proj geos arrow podofo yay/pacaur/yaourt/whatever -S udunits

renv or conda

There are several reports that sf fails to install as a source package when R is used with renv, or when R is installed in a conda environment. If you experience this, please do not raise an issue here, but

  • try to sort this out with the renv developers or the conda maintainers, or
  • try to use binary installs of the sf package, e.g. from r2u, or the Posit package manager

Other

To install on Debian, the rocker geospatial Dockerfiles may be helpful. Ubuntu Dockerfiles are found here.

Multiple GDAL, GEOS and/or PROJ versions on your system

If you use dynamic linking (installation from source) and have multiple versions of these libraries installed (e.g. one from ubuntugis-unstable, another installed from source in /usr/local/lib) then this will in general not work, even when setting LD_LIBRARY_PATH manually. See here for the reason why.

lwgeom

Functions and methods that require liblwgeom, including ellipsoidal (not spherical or Euclidean) metrics (area, distances), are provide by and used from lwgeom, which is also on CRAN.

Contributing

  • Contributions of all sorts are most welcome, issues and pull requests are the preferred ways of sharing them.
  • When contributing pull requests, please adhere to the package style (in package code use = rather than <-; don't change indentation; tab stops of 4 spaces are preferred).
  • This project is released with a Contributor Code of Conduct. By participating in this project, you agree to abide by its terms.

How to cite

Package sf can be cited as:

Acknowledgment

This project gratefully acknowledges financial support from the

<!-- -->

Owner

  • Name: r-spatial
  • Login: r-spatial
  • Kind: organization

For packages raster, terra, dismo & geosphere visit the rspatial github organisation (mind the missing '-')

GitHub Events

Total
  • Issues event: 101
  • Watch event: 64
  • Issue comment event: 256
  • Push event: 117
  • Pull request review event: 2
  • Pull request review comment event: 3
  • Pull request event: 35
  • Fork event: 14
Last Year
  • Issues event: 101
  • Watch event: 64
  • Issue comment event: 256
  • Push event: 117
  • Pull request review event: 2
  • Pull request review comment event: 3
  • Pull request event: 35
  • Fork event: 14

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 4,555
  • Total Committers: 125
  • Avg Commits per committer: 36.44
  • Development Distribution Score (DDS): 0.212
Past Year
  • Commits: 145
  • Committers: 10
  • Avg Commits per committer: 14.5
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email Commits
Edzer Pebesma e****a@u****e 3,589
Etienne B. Racine e****r@g****m 128
Robin Lovelace r****x@g****m 80
pat-s p****z@g****m 67
Andy Teucher a****r@g****m 55
Roger Bivand R****d@g****m 54
olivroy o****1@h****m 43
Dewey Dunnington d****y@f****t 35
Lionel Henry l****y@g****m 30
Krzysztof Dyba 3****b 30
Dan Baston d****n@i****m 27
Michael Sumner m****r@g****m 24
Thomas Lin Pedersen t****5@g****m 21
Michael Chirico m****4@g****m 21
jn t****i@g****m 21
Hiroaki Yutani y****i@g****m 19
Jeroen Ooms j****s@g****m 18
Andrea a****i@u****t 17
mpadge m****m@e****m 15
David Hugh-Jones d****s@g****m 11
Shinya Uryu s****7@g****m 10
Kirill Müller k****r@m****g 10
karldw k****w 9
rubak r****k@m****k 9
Darius A. Görgen i****o@d****m 8
SymbolixAU d****y@s****u 8
Uchida Mizuki u****i@v****t 6
Daniel Possenriede p****e@g****m 6
florisvdh f****e@i****e 5
Matthieu Stigler M****r@g****m 5
and 95 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 400
  • Total pull requests: 157
  • Average time to close issues: 3 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 279
  • Total pull request authors: 35
  • Average comments per issue: 5.45
  • Average comments per pull request: 1.22
  • Merged pull requests: 108
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 76
  • Pull requests: 51
  • Average time to close issues: 8 days
  • Average time to close pull requests: 7 days
  • Issue authors: 64
  • Pull request authors: 9
  • Average comments per issue: 2.83
  • Average comments per pull request: 0.47
  • Merged pull requests: 37
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rsbivand (17)
  • latot (15)
  • edzer (12)
  • kadyb (10)
  • agila5 (8)
  • JosiahParry (7)
  • bart1 (6)
  • dbaston (4)
  • mem48 (4)
  • lvalnegri (4)
  • goergen95 (4)
  • ramiromagno (3)
  • arthurgailes (3)
  • dominiqueweber (3)
  • DOSull (3)
Pull Request Authors
  • kadyb (24)
  • rsbivand (19)
  • olivroy (18)
  • MichaelChirico (14)
  • agila5 (12)
  • faridcher (9)
  • bart1 (7)
  • rouault (4)
  • andrewbaxter439 (4)
  • UchidaMizuki (4)
  • paleolimbot (3)
  • goergen95 (3)
  • edzer (3)
  • kalibera (2)
  • djhshih (2)
Top Labels
Issue Labels
reprex (11) feature (9) bug (4) help wanted :heart: (1) needs proper formatting (1)
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • cran 415,386 last-month
  • Total docker downloads: 1,142,297
  • Total dependent packages: 866
    (may contain duplicates)
  • Total dependent repositories: 2,658
    (may contain duplicates)
  • Total versions: 89
  • Total maintainers: 1
cran.r-project.org: sf

Simple Features for R

  • Versions: 67
  • Dependent Packages: 818
  • Dependent Repositories: 2,616
  • Downloads: 415,386 Last month
  • Docker Downloads: 1,142,297
Rankings
Downloads: 0.0%
Dependent packages count: 0.2%
Dependent repos count: 0.2%
Forks count: 0.2%
Stargazers count: 0.2%
Average: 3.0%
Docker downloads count: 17.3%
Last synced: 6 months ago
conda-forge.org: r-sf
  • Versions: 21
  • Dependent Packages: 48
  • Dependent Repositories: 21
Rankings
Dependent packages count: 1.5%
Dependent repos count: 7.9%
Average: 8.0%
Forks count: 10.8%
Stargazers count: 11.9%
Last synced: 6 months ago
anaconda.org: r-sf
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 21
Rankings
Forks count: 20.5%
Stargazers count: 22.3%
Average: 29.7%
Dependent repos count: 32.8%
Dependent packages count: 43.4%
Last synced: 8 months ago

Dependencies

.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/tic-db.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v2 composite
  • pat-s/always-upload-cache v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
  • kartoza/postgis * docker
DESCRIPTION cran
  • R >= 3.3.0 depends
  • methods * depends
  • DBI >= 0.8 imports
  • Rcpp >= 0.12.18 imports
  • classInt >= 0.4 imports
  • grDevices * imports
  • graphics * imports
  • grid * imports
  • magrittr * imports
  • s2 >= 1.1.0 imports
  • stats * imports
  • tools * imports
  • units >= 0.7 imports
  • utils * imports
  • Matrix * suggests
  • RPostgreSQL * suggests
  • RPostgres >= 1.1.0 suggests
  • RSQLite * suggests
  • blob * suggests
  • covr * suggests
  • dplyr >= 0.8 suggests
  • ggplot2 * suggests
  • knitr * suggests
  • lwgeom >= 0.2 suggests
  • maps * suggests
  • mapview * suggests
  • microbenchmark * suggests
  • odbc * suggests
  • pbapply * suggests
  • pillar * suggests
  • pool * suggests
  • raster * suggests
  • rlang * suggests
  • rmarkdown * suggests
  • sp >= 1.2 suggests
  • spatstat >= 2.0 suggests
  • spatstat.geom * suggests
  • spatstat.linnet * suggests
  • spatstat.random * suggests
  • spatstat.utils * suggests
  • stars >= 0.2 suggests
  • terra * suggests
  • testthat >= 3.0.0 suggests
  • tibble >= 1.4.1 suggests
  • tidyr >= 1.2.0 suggests
  • tidyselect >= 1.0.0 suggests
  • tmap >= 2.0 suggests
  • vctrs * suggests
  • wk * suggests
inst/docker/alma/Dockerfile docker
  • almalinux 8.5 build
inst/docker/arrow/Dockerfile docker
  • ubuntu 22.04 build
inst/docker/base/Dockerfile docker
  • ubuntu 16.04 build
inst/docker/bionic/Dockerfile docker
  • ubuntu 18.04 build
inst/docker/cran/Dockerfile docker
  • debian testing build
inst/docker/custom/Dockerfile docker
  • ubuntu 18.04 build
inst/docker/devel/Dockerfile docker
  • ubuntu 22.04 build
inst/docker/fedora/Dockerfile docker
  • fedora latest build
inst/docker/gdal/Dockerfile docker
  • ubuntu 22.04 build
inst/docker/geos/Dockerfile docker
  • ubuntu 18.04 build
inst/docker/lowest/Dockerfile docker
  • rcheckdeb latest build
inst/docker/gdal304/Dockerfile docker
  • ubuntu 22.04 build
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite