List - R Geospatial Packages
Overview
Curated collection of R packages for geospatial analysis, visualization, and data access. Based on the CRAN Spatial Task View and practical experience.
Installation
Install all core packages:
ctv::install.views("Spatial", coreOnly = TRUE)
Core Spatial Packages
The foundational packages for working with spatial data in R.
| Package | Description | Links |
|---|---|---|
| sf | Simple Features for R - modern vector data standard (OGC compliant) | CRAN - Docs |
| terra | Raster and vector spatial data analysis (successor to raster) | CRAN - Docs |
| stars | Spatiotemporal arrays and raster/vector data cubes | CRAN - Docs |
| sp | Legacy spatial classes (superseded by sf) | CRAN |
Geometry Operations
| Package | Description | Links |
|---|---|---|
| lwgeom | Lightweight geometry engine functions for sf | CRAN |
| geos | High-performance GEOS bindings | CRAN |
| s2 | Spherical geometry operations (used by sf) | CRAN |
| wk | Well-known geometry parsing and writing | CRAN |
| sfheaders | Fast construction of sf objects | CRAN |
| geosphere | Spherical trigonometry for geographic calculations | CRAN |
Data Access - Census & Demographics
| Package | Description | Links |
|---|---|---|
| tidycensus | US Census Bureau data in tidy format with geometry | CRAN - Docs |
| tigris | US Census TIGER/Line shapefiles (boundaries, roads, water) | CRAN |
| censusapi | Access all Census Bureau APIs | CRAN |
Data Access - Federal & Government
| Package | Description | Links |
|---|---|---|
| FedData | Download SSURGO, NED, NHD, NLCD and other federal data | CRAN - Docs |
| elevatr | Elevation data from multiple sources (AWS, OpenTopography) | CRAN |
| soilDB | NRCS soil databases (SSURGO, STATSGO) | CRAN |
| geodata | Climate, elevation, soil, crop, species occurrence data | CRAN |
| terrainr | USGS National Map services | CRAN |
Data Access - OpenStreetMap
| Package | Description | Links |
|---|---|---|
| osmdata | OpenStreetMap data via Overpass API | CRAN - Docs |
| osmextract | Download and convert large OSM extracts | CRAN |
| OpenStreetMap | OSM raster images | CRAN |
Data Access - Natural & Global
| Package | Description | Links |
|---|---|---|
| rnaturalearth | Natural Earth map data (countries, coastlines, etc.) | CRAN |
| rnaturalearthdata | Natural Earth datasets | CRAN |
| giscoR | Eurostat GISCO spatial data | CRAN |
| cshapes | Historical country boundaries (1886-today) | CRAN |
Data Access - Remote Sensing
| Package | Description | Links |
|---|---|---|
| rstac | SpatioTemporal Asset Catalog (STAC) client | CRAN |
| rsi | Awesome Spectral Indices and STAC data | CRAN |
| rgee | Google Earth Engine client | CRAN |
| MODISTools | MODIS Land Products Subsets | CRAN |
| sits | Satellite image time series analysis | CRAN |
Visualization - Interactive Web Maps
| Package | Description | Links |
|---|---|---|
| leaflet | Interactive maps via Leaflet.js | CRAN - Docs |
| leaflet.extras | Additional Leaflet plugins | CRAN |
| leaflet.extras2 | More Leaflet plugins (time slider, etc.) | CRAN |
| leafem | Leaflet extensions for mapview | CRAN |
| leaflegend | Custom legends for Leaflet | CRAN |
| mapview | Quick interactive viewing of spatial data | CRAN |
| mapdeck | Deck.gl and Mapbox GL maps | CRAN |
| mapgl | MapLibre/Mapbox GL interface | GitHub |
Leaflet
# leaflet
library(leaflet)
library(leaflet.extras)
library(leaflet.extras2)
library(leafem)
library(leaflet.providers)
library(leafgl)
library(leaflet.opacity)
library(leaflet.esri)
library(leaf.magic)
library(leaflegend)
library(leafsync)
library(leafdown)
library(leafsync)
library(leafpop)Visualization - Static Maps
| Package | Description | Links |
|---|---|---|
| tmap | Thematic maps with grammar of graphics | CRAN - Docs |
| mapsf | Thematic cartography (successor to cartography) | CRAN |
| ggplot2 | Grammar of graphics with geom_sf | CRAN |
| ggspatial | ggplot2 extensions (north arrows, scale bars) | CRAN |
| ggmap | ggplot2 with Google Maps and OSM | CRAN |
| rayshader | 3D visualization and hillshading | CRAN |
Database Connectivity
| Package | Description | Links |
|---|---|---|
| rpostgis | PostGIS interface | CRAN |
| RPostgres | PostgreSQL driver (works with PostGIS) | CRAN |
| pool | Database connection pooling | CRAN |
ArcGIS & Esri Integration
| Package | Description | Links |
|---|---|---|
| arcgislayers | Read ArcGIS Feature Services | CRAN |
| arcgisutils | ArcGIS REST API utilities | CRAN |
| esri2sf | Convert Esri services to sf | GitHub |
| arcpullr | Pull ArcGIS REST API data | CRAN |
Spatial Analysis & Geostatistics
| Package | Description | Links |
|---|---|---|
| gstat | Geostatistical modeling and kriging | CRAN |
| spdep | Spatial dependence and autocorrelation | CRAN |
| spatialreg | Spatial regression models (SAR, CAR) | CRAN |
| spatstat | Point pattern analysis | CRAN |
| exactextractr | Fast zonal statistics | CRAN |
Network Analysis
| Package | Description | Links |
|---|---|---|
| sfnetworks | Tidy spatial network analysis | CRAN |
| stplanr | Sustainable transport planning | CRAN |
Geocoding
| Package | Description | Links |
|---|---|---|
| tidygeocoder | Tidy geocoding with multiple services | CRAN |
File I/O & Utilities
| Package | Description | Links |
|---|---|---|
| gdalraster | GDAL API bindings for raster/vector | CRAN |
| vapour | Low-level GDAL access | CRAN |
| rmapshaper | Mapshaper for topology-aware simplification | CRAN |
| geojsonio | GeoJSON I/O | CRAN |
LiDAR & Point Clouds
Classification & Color
| Package | Description | Links |
|---|---|---|
| classInt | Class interval algorithms for thematic maps | CRAN |
| viridis | Color-blind friendly palettes | CRAN |
| RColorBrewer | ColorBrewer palettes | CRAN |
Notes
- For related configurations, see Code - R - GDAL Geospatial Operations
- For setup guides, see Guide - R Coding Conventions
- See also the Geocomputation with R book
Appendix
Created: 2024-12-22 | Modified: 2024-12-22
See Also
Backlinks
(c) No Clocks, LLC | 2024