Modeling & SimulationCompleted2025

Nitrogen Loss Risk Spatial Analysis

Nationwide spatial risk mapping of German organic farms using Local Moran's I and Getis-Ord Gi* hotspot analysis. Cleaned 79,125 farm records, implemented IDW and Ordinary Kriging interpolation, and proved statistically significant clustering (p<0.05) linking sandy soils to high-risk zones.

Nitrogen Loss Risk Spatial Analysis

Gallery

Problem

Nitrogen losses from organic agriculture (N₂O emissions, nitrate leaching) contribute to climate change and groundwater contamination. Germany's 79,000+ organic farms operate under vastly different soil, climate, and management conditions. Traditional farm-level assessments miss landscape-scale patterns. Critical question: Are nitrogen losses randomly distributed, or do they cluster geographically? If clustering exists, policymakers need spatial evidence to target interventions efficiently rather than blanket regulations.

Approach

Executed rigorous data preparation pipeline cleaning 93,552 farm records (removed 14,427 with invalid soil texture: sand >100%, negative silt fractions). Implemented two-stage texture correction: clipped values to [0,100], normalized to sum 100%, derived USDA texture classes. Reprojected to EPSG:31467 (Gauss-Krüger Zone 3) for metric-based spatial operations. Compared Inverse Distance Weighting (IDW, deterministic, fast) and Ordinary Kriging (geostatistical, uncertainty-aware) for interpolating N₂O, nitrate, N surplus, and composite N-Risk Index across Germany. Applied dual spatial statistics: Local Moran's I (LISA) to detect cluster types (HH/LL/HL/LH), and Getis-Ord Gi* to compute Z-scores for hotspot significance testing (p<0.05). Constructed spatial weights matrix (K-nearest neighbors, k=8) and applied Bonferroni correction for multiple testing.

Data

Final dataset: 79,125 spatially-consistent organic farm records with four nitrogen loss indicators (N₂O emissions in kg N₂O-N ha⁻¹ yr⁻¹, nitrate leaching in kg N ha⁻¹ yr⁻¹, nitrogen surplus in kg N ha⁻¹ yr⁻¹, composite N-Risk Index), corrected soil texture (sand/silt/clay summing to 100% with derived USDA classes), and climate variables (annual rainfall, mean temperature). Farm locations cover all of Germany with complete geographic coverage in EPSG:31467 projection.

Validation

IDW and Kriging produced consistent spatial trends, validating robustness of identified hotspots. Kriging provided standard error maps quantifying interpolation uncertainty (high error in data-sparse regions). Dual validation using both Local Moran's I and Getis-Ord Gi* showed agreement: same regions identified as significant clusters by both methods, strengthening confidence that patterns are real, not interpolation artifacts. Correlation analysis confirmed expected relationships: sandy soils correlate with higher nitrate leaching, clay soils with lower losses.

Results

Proved non-random spatial clustering (p<0.05) across all nitrogen loss indicators using dual statistical validation. High-risk hotspots associated with sandy soils (low nutrient retention), intensive management zones, and high-rainfall regions. Low-risk coldspots concentrated in clay-rich soils (strong cation exchange capacity), lower rainfall areas, and potential best-practice farming systems. Quantified spatial autocorrelation strength, produced publication-quality maps with quantile classification, and identified priority regions for targeted policy interventions. Created uncertainty maps showing where additional farm monitoring is most needed.

My Role

GIS Analyst & Developer (team with Ahmed Bin Abdus Salam, Maximilian Schütz). Performed data cleaning in Python/R, implemented spatial interpolation in QGIS, executed hotspot analysis using PySAL, created reproducible workflows, and interpreted spatial patterns for policy recommendations.

Next Steps

Machine Learning extension: train Random Forest/XGBoost to predict N-risk from soil/climate features for data-sparse regions. Multi-Criteria Decision Analysis (MCDA) integrating environmental risk with economic constraints. Temporal expansion to multi-year dataset for trend analysis. Field validation campaign with soil sampling transects in predicted hotspots to ground-truth leaching models.

Key Outcomes

  • 79,125 farms analyzed with dual spatial validation
  • Statistically significant clustering confirmed (p<0.05)
  • IDW and Kriging interpolation implemented
  • Sandy soil hotspots vs clay-rich coldspots identified
  • Reproducible R/Python/QGIS workflow

Tech Stack

PythonPySALGeoPandasQGISR

Tags

geospatialspatial-statisticsgispolicykrigingpython