MyNixOS website logo
Description

Comprehensive Geospatiotemporal Analysis and Multimodal Integration Toolkit.

A comprehensive toolkit for geospatiotemporal analysis featuring 60+ vegetation indices, advanced raster visualization, universal spatial mapping, water quality analysis, CDL crop analysis, spatial interpolation, temporal analysis, and terrain analysis. Designed for agricultural research, environmental monitoring, remote sensing applications, and publication-quality mapping with support for any geographic region and robust error handling. Methods include vegetation indices calculations (Rouse et al. 1974), NDVI and enhanced vegetation indices (Huete et al. 1997) <doi:10.1016/S0034-4257(97)00104-1>, (Akanbi et al. 2024) <doi:10.1007/s41651-023-00164-y>, spatial interpolation techniques (Cressie 1993, ISBN:9780471002556), water quality indices (McFeeters 1996) <doi:10.1080/01431169608948714>, and crop data layer analysis (USDA NASS 2024) <https://www.nass.usda.gov/Research_and_Science/Cropland/>. Funding: This material is based upon financial support by the National Science Foundation, EEC Division of Engineering Education and Centers, NSF Engineering Research Center for Advancing Sustainable and Distributed Fertilizer production (CASFER), NSF 20-553 Gen-4 Engineering Research Centers award 2133576.

geospatialsuite 🌍

CRANstatus TotalDownloads License:MIT

Comprehensive Geospatiotemporal Analysis and Multimodal Integration Toolkit for R

geospatialsuite is a powerful R package for geospatial analysis featuring 60+ vegetation indices, universal spatial analysis, auto-geocoding without coordinates, efficient raster visualization, and comprehensive workflows for agricultural research, environmental monitoring, and remote sensing applications.

πŸ“‹ Table of Contents

πŸ”— Quick Links

✨ Key Features

πŸ—ΊοΈ Auto-Geocoding Without Coordinates

  • Work with data that has NO lat/lon! Automatically geocode using geographic identifiers
  • States: Full names or abbreviations (e.g., β€œOhio”, β€œOH”)
  • Counties: County names with or without state
  • FIPS codes: 5-digit Federal codes
  • HUC codes: Watershed codes (handles HUC_8, HUC-8, huc8, etc.)
  • ZIP codes: US postal codes
  • Cities: City names (works best with state column)
  • Flexible column naming: Handles spaces, hyphens, underscores, mixed case

🌱 Advanced Vegetation Analysis

  • 60+ vegetation indices including NDVI, EVI, SAVI, PRI, SIPI, NDRE, MTCI
  • Automatic band detection from Landsat, Sentinel, and other satellite imagery
  • Crop-specific analysis for corn, soybeans, wheat, cotton, rice
  • Stress detection and yield assessment workflows

πŸ—ΊοΈ Universal Spatial Analysis

  • Works with ANY data combination - points, polygons, rasters
  • Automatic coordinate system handling and spatial validation
  • Multiple extraction methods - simple, buffer, bilinear, nearest neighbor
  • Multi-dataset integration for comprehensive environmental analysis

πŸ“Š Efficient Visualization

  • No data frame conversion for large rasters (uses tidyterra, RStoolbox)
  • Interactive maps with leaflet integration
  • Publication-quality graphics with automatic method selection
  • RGB composites with advanced stretching algorithms

πŸ”„ Comprehensive Workflows

  • End-to-end analysis pipelines for common geospatial tasks
  • NDVI crop analysis with quality filtering and temporal smoothing
  • Water quality assessment with spatial integration
  • Terrain and temporal analysis workflows

⚑ Performance Features

  • Smart fallback systems when optional packages unavailable
  • Parallel processing support for multiple indices
  • Efficient memory usage optimized for large datasets
  • Robust error handling with informative messages

πŸ“¦ Installation

From CRAN (Recommended)

# Install the stable version from CRAN
install.packages("geospatialsuite")

Development Version from GitHub

# install.packages("devtools")
devtools::install_github("cwru-sdle/geospatialsuite")

πŸš€ Quick Start

Load Package and Test Installation

library(geospatialsuite)

# Test your installation
test_geospatialsuite_package_simple()

# Check function availability
test_function_availability(verbose = TRUE)

Basic Usage Examples

# Load built-in sample data
red <- load_sample_data("sample_red.rds")
nir <- load_sample_data("sample_nir.rds")
blue <- load_sample_data("sample_blue.rds")
study_sites <- load_sample_data("sample_coordinates.csv")

# 1. One-line mapping (auto-detects everything!)
quick_map(red, title = "Red Band")

# 2. Universal spatial join (most common operation- Requires your own data)
result <- universal_spatial_join(
  source_data = study_sites,
  target_data = red,
  method = "extract"
)

# 3. Calculate vegetation indices with sample data
ndvi <- calculate_vegetation_index(
  red = red, 
  nir = nir, 
  index_type = "NDVI",
  verbose = TRUE
)

# 4. Enhanced NDVI with quality filtering
enhanced_ndvi <- calculate_ndvi_enhanced(
  red = red,
  nir = nir,
  quality_filter = TRUE
)

# 5. Multiple indices at once
indices <- calculate_multiple_indices(
  red = red, 
  nir = nir, 
  blue = blue,
  indices = c("NDVI", "EVI", "SAVI"),
  output_stack = TRUE
)

πŸ—ΊοΈ Auto-Geocoding Without Coordinates

Work with data that doesn’t have latitude/longitude coordinates. geospatialsuite automatically detects and geocodes geographic identifiers:

# Works with state names or abbreviations
state_data <- data.frame(
  state = c("Ohio", "PA", "Michigan"),
  population = c(11.8, 13.0, 10.1)
)
spatial_data <- auto_geocode_data(state_data)


# Works with FIPS codes
county_data <- data.frame(
  fips = c("39049", "39035", "39113"),
  unemployment = c(4.2, 5.1, 4.8)
)
county_sf <- auto_geocode_data(county_data)

# Works with HUC codes (any format!)
watershed_data <- data.frame(
  HUC_8 = c("04100009", "04100012"),  # or HUC-8, huc8, Huc 8, etc.
  water_quality = c(72, 65)
)
huc_sf <- auto_geocode_data(watershed_data)

# Works with ZIP codes
zip_data <- data.frame(
  zip = c("43215", "44113", "45202"),
  median_income = c(58000, 45000, 72000)
)
zip_sf <- auto_geocode_data(zip_data)

# Preview what will be detected before geocoding
preview_geocoding(my_data)

Supported geographic entities: - βœ… States (names or abbreviations) - βœ… Counties - βœ… FIPS codes - βœ… HUC watershed codes (HUC-8, HUC_8, huc8, etc.) - βœ… ZIP codes - βœ… City names

Column name flexibility: The package handles any naming convention - HUC_8, HUC-8, huc8, State, STATE, state_name, etc.

πŸ“– Documentation

Function Reference

# View all available functions
help(package = "geospatialsuite")

# Auto-geocoding functions
?auto_geocode_data
?preview_geocoding

# Test function availability
test_function_availability()

# Run basic package tests
test_geospatialsuite_package_simple()

# Run minimal functionality test
test_package_minimal(verbose = TRUE)

🎯 Real-World Examples

Census Data Analysis (No Coordinates Needed!)

# Load census data with just state names - no coordinates!
census_data <- data.frame(
  state = c("California", "Texas", "Florida", "New York"),
  population_millions = c(39.5, 29.1, 22.2, 20.2),
  median_income = c(75000, 64000, 59000, 72000),
  unemployment_rate = c(4.8, 4.1, 3.2, 4.3)
)

# Auto-geocode and visualize
census_sf <- auto_geocode_data(census_data, verbose = TRUE)
quick_map(census_sf, variable = "median_income", 
          title = "Median Household Income by State")

Watershed Analysis with HUC Codes

# Water quality data with HUC-8 codes (no coordinates!)
watershed_data <- data.frame(
  HUC_8 = c("04100009", "04100012", "04110002", "05120201"),
  basin_name = c("Great Miami", "Mill Creek-Cincinnati", 
                 "Middle Ohio", "Upper Wabash"),
  nitrogen_mg_l = c(2.3, 3.1, 1.8, 2.7),
  phosphorus_mg_l = c(0.08, 0.12, 0.06, 0.09)
)

# Auto-geocode watersheds
huc_sf <- auto_geocode_data(watershed_data, verbose = TRUE)

# Comprehensive water quality analysis
water_results <- analyze_water_quality_comprehensive(
  water_data = huc_sf,
  variable = "nitrogen_mg_l",
  thresholds = list(
    Normal = c(0, 2), 
    Elevated = c(2, 5),
    High = c(5, Inf)
  )
)

quick_map(huc_sf, variable = "nitrogen_mg_l",
          title = "Nitrogen Levels by Watershed")

Agricultural Monitoring Crop Codes

# Get crop codes for analysis
corn_codes <- get_comprehensive_cdl_codes("corn")
grain_codes <- get_comprehensive_cdl_codes("grains")

County-Level Environmental Analysis

# County data with FIPS codes (no coordinates needed!)
county_data <- data.frame(
  fips = c("39049", "39035", "39113", "39061"),
  county_name = c("Franklin", "Cuyahoga", "Montgomery", "Hamilton"),
  air_quality_index = c(45, 52, 48, 41),
  tree_canopy_pct = c(28, 35, 32, 40)
)

# Auto-geocode counties
county_sf <- auto_geocode_data(county_data, verbose = TRUE)

Analyse crop vegetation

red <- load_sample_data("sample_red.rds")
nir <- load_sample_data("sample_nir.rds")
blue <- load_sample_data("sample_blue.rds")

spectral_stack <- c(red, nir, blue)

names(spectral_stack) <- c("red", "nir", "blue")

result <- analyze_crop_vegetation(
  spectral_data = spectral_stack,
  crop_type = "corn",
  analysis_type = "comprehensive"
)

# Structure:
result$vegetation_indices      # SpatRaster with calculated indices
result$analysis_results        # Detailed analysis results
result$metadata                # Processing metadata

Crop Classification Methodology

analyze_crop_vegetation() classifies vegetation stress, growth stage, and yield potential using literature-informed thresholds across multiple indices:

  • Stress detection applies independent thresholds to each available index (NDVI, EVI, GNDVI, SIPI). NDVI stress ranges (healthy β‰₯ 0.6, moderate stress 0.4–0.6, severe stress < 0.4) follow Tucker (1979) and Hatfield et al.Β (2008). EVI and GNDVI thresholds are similarly derived from Hatfield et al.Β (2008).

  • Growth stage is predicted from mean NDVI using crop-specific cutoffs consistent with Anyamba et al.Β (2021), who applied explicit per-crop NDVI thresholds for large-scale crop monitoring with MODIS and crop mask data β€” the same conceptual approach used here. The MODIS + CDL crop monitoring framework follows Akanbi et al.Β (2024).

  • Yield potential uses a composite score averaging up to five normalized indices (NDVI, EVI, GNDVI, DVI, RVI), consistent with the multi-index approach of Bolton & Friedl (2013) and Mkhabela et al.Β (2011).

Note: Thresholds are literature-informed starting points. Exact NDVI boundaries vary by region, cultivar, sensor, and season. Calibration with local ground truth data is recommended.

References: - Tucker (1979). Remote Sensing of Environment, 8(2), 127–150. https://doi.org/10.1016/0034-4257(79)90013-0

🌟 What Makes geospatialsuite Special

1. Auto-Geocoding Revolution

No more manual coordinate lookups! Work directly with: - State names, county names, FIPS codes - HUC watershed codes (any format) - ZIP codes, city names - Flexible column naming (HUC_8, HUC-8, huc8 all work!)

2. Universal Design

Works with any spatial data combination - no need to learn different functions for different data types. The universal_spatial_join() function automatically handles: - Vector-to-vector joins - Vector-to-raster extractions

  • Raster-to-raster operations - Multi-dataset integrations

3. Intelligent Automation

  • Auto-detects coordinate columns (lat/lng, x/y, longitude/latitude)
  • Auto-geocodes geographic entities (states, counties, FIPS, HUCs, ZIPs)
  • Automatically identifies satellite bands across Landsat, Sentinel-2, MODIS
  • Smart coordinate system transformations with validation
  • Optimal method selection for performance and accuracy

4. Efficient Visualization

  • Terra-based plotting using reliable terra::plot() and terra::plotRGB()
  • Quick mapping with quick_map() function for instant visualization
  • Multiple color schemes: viridis, plasma, ndvi, terrain, categorical
  • Interactive mapping with automatic leaflet integration when available

5. Comprehensive Coverage

  • 60+ vegetation indices including latest research developments
  • Complete spatial operations through universal_spatial_join()
  • Robust error handling with informative messages and recovery strategies
  • Cross-platform compatibility (Windows, macOS, Linux)

6. Research-Ready

Designed specifically for reproducible research with: - Comprehensive testing suite (test_geospatialsuite_package_simple()) - Function availability checking (test_function_availability()) - Quality control and filtering options - Integration with modern R spatial ecosystem

⚑ Performance

geospatialsuite is optimized for:

  • Large rasters: Efficient memory usage with terra backend
  • Multiple datasets: Parallel processing capabilities for vegetation indices
  • Cross-platform: Tested on Windows, macOS, and Linux
  • Any geographic region: Universal coordinate system handling
  • Big data: Streaming and chunked processing for large satellite imagery
  • Interactive analysis: Fast visualization without data conversion overhead
  • Geocoding: Efficient caching and batch processing for large datasets

For realistic satellite imagery (5KΓ—5K pixels):

  • 7.6Γ— more memory efficient than ggplot2 (75 MB vs 572 MB)
  • 4.2Γ— faster execution (684 ms vs 2,897 ms)

Performance Tips

# Test basic functionality
test_package_minimal(verbose = TRUE)

# Check which functions are available
test_function_availability(verbose = TRUE)

πŸ“Š Supported Vegetation Indices

Click to see all 60+ vegetation indices (full table)

#IndexCategoryApplicationRequired BandsDescription
1NDVIbasicgeneralRed, NIRNormalized Difference Vegetation Index
2SAVIbasicsoilRed, NIRSoil Adjusted Vegetation Index
3MSAVIbasicsoilRed, NIRModified Soil Adjusted Vegetation Index
4OSAVIbasicsoilRed, NIROptimized Soil Adjusted Vegetation Index
5EVIbasicgeneralRed, NIR, BlueEnhanced Vegetation Index
6EVI2basicgeneralRed, NIRTwo-band Enhanced Vegetation Index
7DVIbasicbiomassRed, NIRDifference Vegetation Index
8RVIbasicgeneralRed, NIRRatio Vegetation Index
9GNDVIbasicchlorophyllGreen, NIRGreen NDVI
10WDVIbasicsoilRed, NIRWeighted Difference Vegetation Index
11ARVIenhancedatmosphericRed, NIR, BlueAtmospherically Resistant Vegetation Index
12RDVIenhancedgeneralRed, NIRRenormalized Difference Vegetation Index
13PVIenhancedgeneralRed, NIRPerpendicular Vegetation Index
14IPVIenhancedgeneralRed, NIRInfrared Percentage Vegetation Index
15TNDVIenhancedgeneralRed, NIRTransformed NDVI
16GEMIenhancedgeneralRed, NIRGlobal Environment Monitoring Index
17VARIenhancedgeneralRed, Green, BlueVisible Atmospherically Resistant Index
18TSAVIenhancedsoilRed, NIRTransformed Soil Adjusted VI
19ATSAVIenhancedsoilRed, NIRAdjusted Transformed Soil Adjusted VI
20GESAVIenhancedsoilRed, NIRGeneralized Soil Adjusted VI
21MTVIenhancedgeneralRed, NIRModified Triangular VI
22CTVIenhancedcanopyRed, NIRCorrected Transformed VI
23NDREadvancedstressNIR, RedEdgeNormalized Difference Red Edge
24MTCIadvancedstressRedEdge, NIRMERIS Terrestrial Chlorophyll Index
25IRECIadvancedstressRedEdge, NIRInverted Red-Edge Chlorophyll Index
26S2REPadvancedstressRedEdgeSentinel-2 Red-Edge Position
27PSRIadvancedstressRedEdge, NIRPlant Senescence Reflectance Index
28CRI1advancedstressRed, GreenCarotenoid Reflectance Index 1
29CRI2advancedstressRedEdge, GreenCarotenoid Reflectance Index 2
30ARI1advancedstressRedEdge, GreenAnthocyanin Reflectance Index 1
31ARI2advancedstressRedEdge, NIRAnthocyanin Reflectance Index 2
32MCARIadvancedstressRed, GreenModified Chlorophyll Absorption Ratio Index
33PRIstressstressGreen, NIRPhotochemical Reflectance Index
34SIPIstressstressRed, NIRStructure Insensitive Pigment Index
35CCIstressstressRedEdge, GreenCanopy Chlorophyll Index
36NDNIstressstressNIR, SWIR1Normalized Difference Nitrogen Index
37CARIstressstressRed, GreenChlorophyll Absorption Ratio Index
38TCARIstressstressRed, GreenTransformed Chlorophyll Absorption Ratio Index
39MTVI1stressstressRed, NIRModified Triangular Vegetation Index 1
40MTVI2stressstressRed, NIRModified Triangular Vegetation Index 2
41TVIstressstressRed, NIRTriangular Vegetation Index
42NPCIstressstressRed, BlueNormalized Pigment Chlorophyll Index
43RARSstressstressRed, NIRRatio Analysis of Reflectance Spectra
44NPQIstressstressRed, BlueNormalized Phaeophytinization Index
45NDWIwaterwaterGreen, NIRNormalized Difference Water Index
46MNDWIwaterwaterGreen, SWIR1Modified Normalized Difference Water Index
47NDMIwaterwaterNIR, SWIR1Normalized Difference Moisture Index
48MSIwaterwaterNIR, SWIR1Moisture Stress Index
49NDIIwaterwaterNIR, SWIR1Normalized Difference Infrared Index
50WIwaterwaterNIR, SWIR1Water Index
51SRWIwaterwaterNIR, SWIR1Simple Ratio Water Index
52LSWIwaterwaterNIR, SWIR1Land Surface Water Index
53LAIspecializedforestryRed, NIRLeaf Area Index
54FAPARspecializedforestryRed, NIRFraction of Absorbed PAR
55FCOVERspecializedforestryRed, NIRFraction of Vegetation Cover
56NBRspecializedforestryNIR, SWIR2Normalized Burn Ratio
57BAIspecializedforestryRed, NIRBurn Area Index
58NDSIspecializedsnowGreen, SWIR1Normalized Difference Snow Index
59GRVIspecializedgeneralRed, GreenGreen-Red Vegetation Index
60VIGspecializedgeneralGreen, NIRVegetation Index Green
61CIspecializedcanopyRed, GreenColoration Index
62GBNDVIspecializedgeneralGreen, Blue, NIRGreen-Blue NDVI

Total: 60+ indices with automatic band detection across satellite platforms

πŸ›  System Requirements

Required Dependencies

# Core dependencies (automatically installed with geospatialsuite)
# These are listed in DESCRIPTION Imports and will be installed automatically
terra (>= 1.6-17)
sf (>= 1.0-0)
dplyr (>= 1.0.0)
ggplot2 (>= 3.3.0)
magrittr
viridis
leaflet          # Interactive web mapping
rnaturalearth    # Natural Earth country boundaries
tigris           # US Census boundaries (states, counties, FIPS)
# Plus: graphics, grDevices, htmlwidgets, mice, parallel, 
#       RColorBrewer, stats, stringr, tools, utils

Optional Enhancement Packages

# These packages provide additional functionality but are not required
# Install them separately for enhanced capabilities

# Raster visualization enhancements
install.packages(c(
  "tidyterra",    # Efficient raster visualization with ggplot2
  "RStoolbox"     # Remote sensing tools and visualization
))

# Figure composition and animation
install.packages(c(
  "patchwork",    # Multi-panel figures and layouts
  "gganimate"     # Animated visualizations
))

# Extended geocoding capabilities (listed in DESCRIPTION Suggests)
install.packages(c(
  "nhdplusTools",  # HUC watershed boundaries
  "zipcodeR",      # ZIP code centroids
  "tidygeocoder"   # City name geocoding
))

Minimum R Version

  • R >= 3.5.0 (recommended: R >= 4.0.0)

πŸ“„ Citation

If you use geospatialsuite in your research, please cite:

citation("geospatialsuite")

πŸ“§ Contact

πŸ“ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Development Institution: Solar Durability and Lifetime Extension (SDLE) Center, Case Western Reserve University, Cleveland, Ohio, U.S.A.
  • Built on: The excellent work of the terra, sf, ggplot2, and broader R spatial community
  • Funding: This material is based upon financial support by the National Science Foundation, EEC Division of Engineering Education and Centers, NSF Engineering Research Center for Advancing Sustainable and Distributed Fertilizer production (CASFER), NSF 20-553 Gen-4 Engineering Research Centers award 2133576.

Contributing Institutions

  • Case Western Reserve University
  • NSF Engineering Research Center for Advancing Sustainable and Distributed Fertilizer production (CASFER)

Special Thanks

  • R Core Team and CRAN maintainers
  • terra package developers (Robert J. Hijmans et al.)
  • sf package developers (Edzer Pebesma et al.)
  • Remote sensing and geospatial R community
  • geocoding package developers (tigris, nhdplusTools, zipcodeR, tidygeocoder)

Metadata

Version

0.2.0

License

Unknown

PlatformsΒ (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows