How to Process Satellite Subsidence Data with QGIS on Linux for Urban Mapping
How to Process Satellite Subsidence Data with QGIS on Linux for Urban Mapping
When working with interferometric synthetic aperture radar (InSAR) data from space missions like Sentinel-1 or NISAR, developers often need a reliable, open-source workflow to process and visualize subsidence measurements. This guide walks you through processing satellite subsidence data in QGIS on Linux, using real techniques employed in projects monitoring cities like Mexico City where extreme subsidence has been documented.
Understanding Subsidence Data from Satellite Missions
Modern space missions generate enormous datasets measuring ground deformation. The US-Indian NISAR mission, for example, produces interferometric data showing millimeter-scale vertical displacement across urban areas. As a developer building mapping applications or geospatial analysis tools, you need to:
- Ingest raw SAR data or processed interferograms
- Georectify measurements to real-world coordinates
- Visualize subsidence patterns for analysis or web applications
- Export results in standard GIS formats
QGIS on Linux provides a free, scriptable environment for this entire workflow without vendor lock-in.
Prerequisites and Installation
Before starting, install QGIS 3.34+ on your Linux system. On Ubuntu/Debian:
sudo apt update
sudo apt install qgis qgis-plugin-grass qgis-plugin-grass-data gdal-bin python3-gdal
For Red Hat/Fedora:
sudo dnf install qgis qgis-grass-plugin gdal python3-gdal
Verify installation:
qgis --version
gdalinfo --version
python3 -c "from osgeo import gdal; print(gdal.__version__)"
You'll also want to install the SCP (Semi-Automatic Classification Plugin) which handles satellite data ingestion:
- Open QGIS → Plugins → Manage and Install Plugins
- Search "Semi-Automatic Classification"
- Click Install Plugin
Setting Up Your Project Structure
Create a organized directory structure for processing:
mkdir -p ~/subsidence_project/{raw_data,processed,outputs,scripts}
cd ~/subsidence_project
Download your subsidence data. For testing, you can use freely available Sentinel-1 interferograms from:
- ASF DAAC (Alaska Satellite Facility)
- Copernicus Open Access Hub
- USGS Earth Explorer
Loading and Preparing Subsidence Data in QGIS
Step 1: Create a new project with proper CRS
Open QGIS and create a new project. For Mexico City area:
- Project → Properties → CRS
- Search for "EPSG:32614" (UTM Zone 14N, appropriate for central Mexico)
- Click Select
Step 2: Add your subsidence raster
If you have a processed interferogram (GeoTIFF format):
- Layer → Add Layer → Add Raster Layer
- Navigate to your subsidence file
- Click Add
For raw SAR data, use GDAL to check metadata:
gdalinfo your_interferogram.tif | grep -E "Size|Coordinate|Geotransform"
Step 3: Apply appropriate color ramps
Subsidence data should use a diverging color scheme. In QGIS:
- Right-click layer → Properties
- Symbology tab → Render type: "Singleband pseudocolor"
- Color ramp: Select "RdYlGn" (reversed) or "Spectral"
- Mode: "Equal interval" with 15-20 classes
This makes negative values (subsidence) appear in reds/oranges while positive values show as greens.
Python Scripting for Batch Processing
For developers processing multiple subsidence datasets, automate with QGIS Python API:
from qgis.core import (
QgsProject, QgsRasterLayer, QgsVectorLayer,
QgsMapLayerStyle
)
from qgis.analysis import QgsRasterAnalyzer
import os
# Initialize QGIS
qgs = QgsProject.instance()
qgs.setCrs("EPSG:32614")
# Load subsidence raster
subsidence_path = os.path.expanduser("~/subsidence_project/raw_data/interferogram.tif")
layer = QgsRasterLayer(subsidence_path, "Subsidence")
if not layer.isValid():
print(f"Error loading {subsidence_path}")
exit(1)
qgs.addMapLayer(layer)
# Export to Cloud Optimized GeoTIFF for web use
output_path = os.path.expanduser("~/subsidence_project/outputs/subsidence_cog.tif")
os.system(f"gdal_translate -of COG -co COMPRESS=DEFLATE {subsidence_path} {output_path}")
print(f"Exported COG to {output_path}")
Save this as process_subsidence.py and run via QGIS Python console or from command line:
qgis --nologo --noplugins --code process_subsidence.py
Measuring Subsidence Extent and Severity
Once data is loaded, calculate statistics:
- Raster → Analysis Tools → Raster Statistics
- Select your subsidence layer
- Review output — note min/max subsidence values
For Mexico City, subsidence can exceed 1 meter per decade in affected zones. To identify areas exceeding a threshold (e.g., -0.5m):
gdal_calc.py -A interferogram.tif --outfile=severe_subsidence.tif \
--calc="(A<-0.5)*A" --NoDataValue=0
This creates a new raster showing only areas with subsidence greater than 0.5 meters.
Comparison: QGIS vs. Alternative Geospatial Tools
| Feature | QGIS | ArcGIS | ENVI | Google Earth Engine | |---------|------|--------|------|---------------------| | Cost | Free (open-source) | $$$ | $$$ | Free tier available | | SAR Processing | Via plugins | Native | Excellent | Limited | | Python API | Yes (PyQGIS) | Yes (arcpy) | Yes | Yes (Python API) | | Local Processing | Full control | Cloud-dependent | Full control | Cloud-only | | Batch Automation | Python/GRASS | ModelBuilder | IDL/Python | JavaScript | | Best for | Open-source workflows | Enterprise GIS | Hyperspectral focus | Large-scale analysis |
For developers building custom subsidence monitoring tools, QGIS on Linux offers the most flexibility: you control the entire pipeline, automate with Python, and integrate with web frameworks like Django or FastAPI for real-time dashboards.
Exporting Results for Web Applications
To use subsidence data in web mapping (Leaflet, Mapbox, Cesium):
- Export as Cloud Optimized GeoTIFF for efficient tile serving
- Convert vector boundaries to GeoJSON for overlay
- Create pre-rendered tiles for quick loading
# Create COG
gdal_translate -of COG -co COMPRESS=DEFLATE subsidence.tif subsidence_cog.tif
# Generate tiles (z0-z12)
gdal2tiles.py -z 0-12 -w leaflet subsidence_cog.tif tiles/
Then serve tiles via your web application:
L.tileLayer('tiles/{z}/{x}/{y}.png').addTo(map);
Common Pitfalls and Solutions
Coordinate System Mismatches: Always verify CRS matches your source data. Mexico City data might come in different zones (UTM 14N, WGS84, or local projections). Use gdalinfo to check.
No Data Values: Subsidence rasters often contain -9999 or similar null values. Set these properly in QGIS Properties → Transparency tab to avoid visualization artifacts.
Memory Issues with Large Datasets: For rasters >2GB, enable QGIS Raster Pyramids (right-click layer → Create Spatial Index).
Conclusion
Processing subsidence data from missions like NISAR in QGIS on Linux gives developers a reproducible, automatable workflow for urban monitoring applications. The combination of QGIS's GUI for exploration and Python scripting for production workflows makes it ideal for integrating satellite subsidence measurements into larger geospatial platforms.
Recommended Tools
- DigitalOceanCloud hosting built for developers — $200 free credit for new users
- SupabaseOpen source Firebase alternative with Postgres
- RenderZero-DevOps cloud platform for web apps and APIs