Environmental Systems & Geospatial References

Earth Data Analytics, Mapping Packages, and Data Cubes

Brian Yandell (byandell.github.io)

2026-06-18

Earth Data Analytics & Setup

Earth Data Analytics (EDA) Foundations

ESIIL & EarthLab Programs

Key References

Local Environment Setup

Required Tools

  • Visual Studio Code: Primary IDE.
  • Git Version Control: Already included in tools like RStudio, or install separately.
  • Miniconda: Lightweight Conda package manager.
    • For macOS (M1/M2 Apple Silicon), download and run the Apple Silicon bash installer.

Conda Terminal Commands

Run the following commands in the terminal to set up Miniconda:

# Create target directory
mkdir -p ~/miniconda3

# Download Apple Silicon installer
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh

# Run bash installation script
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3

# Clean up installer script
rm ~/miniconda3/miniconda.sh

See further setup steps in Git, Conda & Bash Setup.

GitHub SSH Key Configuration

Securely connect your local terminal to GitHub using SSH authentication:

Step 1: Generate an SSH Key

Open your terminal and run the key-generator:

ssh-keygen -t ed25519 -C "byandell@wisc.edu"

Press enter to accept the default storage location: ~/.ssh/id_ed25519

Step 2: Copy Public Key

Copy the key to your clipboard using macOS pbcopy:

cat ~/.ssh/id_ed25519.pub | pbcopy
# or alternative pipe syntax
pbcopy < ~/.ssh/id_ed25519.pub

Add the copied key under GitHub settings.

Note

For troubleshooting, see GitHub’s guide on Generating SSH Keys.

Mapping Platforms & R APIs

Open Street Map (OSM) in R

OSM Ecosystem

  • OpenStreetMap: Free, crowdsourced maps and spatial layers.
  • osmdata package: Access and download features (pois, polygons, highways) directly inside R.
  • R vs Python: While Python is highly popular for GIS, R has robust mapping integration.

R Plotting Workflow

Documentation & Guides:

Thematic & Interactive Mapping

Interactive tmap

  • tmap package: Thematic map rendering with static/interactive modes.
  • Toggle between plot mode and interactive viewer.
  • Use make-valid function from sf package to solve multipolygon rendering errors.

Useful Resources

Note

For automated shapefile processing, see Automating maps with GeoPandas and Matplotlib.

Google Maps Platform Access

Google Maps layers are accessible in R via the ggmap package, but require strict authentication:

API Key Setup

  1. Register on the Google Maps Platform.
  2. Enable the Maps Static API.
  3. Generate and secure your API Key.
  4. Note that Google Maps requires billing setup (credit card).

Integration Code

Register the key inside your R script:

library(ggmap)
register_google(key = "YOUR_API_KEY")

Institutional Guidelines

Geospatial Packages & Resources

Books & Online Literature

Stack Overflow Tips

See threads like stack geotiff with stars along to handle complex band + time dimensions.

Desktop GIS & Integration

For advanced geospatial processing, combine R scripts with desktop GIS interfaces:

QGIS Integrations

Other Platforms & Guides

R Geospatial Packages

Data Cube Creation

  • gdalcubes: Form Earth observation data cubes from satellite image collections (e.g. MODIS).
  • sf: Modern vector processing (replacing sp).
  • stars: Spatiotemporal arrays, raster data cubes.

Raster & Tidy Extensions

  • terra: Modern raster & vector processing (replacing legacy raster package).
  • tidyterra: Extends standard tidyverse methods (like ggplot, filter, mutate) to terra raster and vector objects.

[!WARNING] The legacy geospatial package rgdal is now obsolete and has been retired. Developers should transition all workflows to sf and terra.

Repositories & Workshops

Geospatial APIs & Repositories

Download APIs

  • rstac: Search and download satellite data via SpatioTemporal Asset Catalog (STAC) API.
  • osmdata: Retrieve OpenStreetMap coordinates.
  • geos: R API wrapper for the GEOS geometry engine.
  • landsat: Process Landsat multispectral imagery.

Repositories

Coordinate Projections & Datasets

Geospatial data use different Coordinate Reference Systems (CRS). Coordinate transformation is crucial:

Key Reference Projections

  • EPSG:4326: WGS84 - World Geodetic System 1984 (lat/lon coordinates).
  • EPSG:32618: WGS84 for UTM zone 18N (North America projections).
  • EPSG:32730: WGS84 for UTM zone 20S (South America projections).

NEON Project Areas

Geospatial workshop datasets focus on two primary field sites: - Harvard Forest (HARV): - HARV_dsmCrop.tif (surface model). - HARV_DSMhill.tif (hillshade model). - San Joaquin Range (SJER).

Note

Data is hosted on FigShare. See the NEON Raster Introduction for raster tutorials in R.

Geospatial Workshops

Interactive worksheets and hackathons are excellent starting points for hands-on learning:

ESIIL Hackathon 2023

UW-Madison Workshop 2023