Skip to content

About

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

76 Commits

Folders and files

Repository files navigation

SatQuery AI

An Interactive Vision-Language Assistant for Multimodal Remote Sensing Image Analysis through Natural Language Queries

Live Demo API Documentation Python FastAPI

Parameter Specification
Problem Statement ID SIH26167
Ministry / Nodal Agency Indian Space Research Organisation (ISRO)
Category Software
Theme Space Technology
Live Production Deployment https://satquery-ai-sage.vercel.app
Interactive API Documentation https://satquery-ai-sage.vercel.app/docs
Operational Modes Dual-Mode Engine (Neural VLM / Segmenter + Live Multi-API STAC/USGS/Overpass Resolver)

1. Overview & Operational Need

SatQuery AI bridges the divide between raw Earth Observation (EO) satellite telemetry and frontline operational decision-making. Non-GIS specialists, disaster response commanders, and environmental planners can submit plain natural-language requests β€” such as "Highlight flooded regions in Assam", "Identify landslide scars in Wayanad", or "Earthquakes in India" β€” and immediately receive georeferenced vector polygons rendered over satellite imagery, complete with area quantification, practical confidence scores, telemetry breakdowns, and actionable tactical directives.

Strategic Disaster & Geohazard Domains

  1. Riverine Inundation & Embankment Breaches (NDRF / SDMA / CWC): Rapid delineation of riverine floodplains and breached dykes (e.g., Brahmaputra Basin, Assam; Kosi River, Bihar) using cloud-penetrating Synthetic Aperture Radar (SAR) imagery and Copernicus GloFAS river discharge telemetry.
  2. Glacial Lake Outburst Floods (GLOF) & Flash Floods (Sikkim / CWC / NDMA): Rapid mapping of South Lhonak glacial lake breach, Chungthang dam collapse, and downstream Teesta River valley flash flood surge using Sentinel-1A SAR and Cartosat-3.
  3. Differential Land Subsidence & Structural Creep (ISRO SAC / CBRI / NDMA): Interferometric SAR (DInSAR / PSInSAR) mm-level deformation mapping of sinking slopes, surface rupture zones, and compromised civil structures (e.g., Joshimath, Uttarakhand).
  4. Catastrophic Landslides & Debris Flow (GSI / NDMA): Mapping of steep crown failure scarps, railway infrastructure collapses, and deposition fans (e.g., Wayanad Landslide, Kerala; Tupul Railway Yard & NH-2 slope failures, Noney, Manipur) using ISRO Cartosat-3 sub-meter optical and Sentinel-1A DInSAR coherence tracking.
  5. Real-Time Earthquake & Seismic Hazards (USGS / National Center for Seismology): Live dynamic ingestion of global seismic feeds plotting earthquake epicenters, Richter magnitudes, focal depths, and geodetic shake impact radii.
  6. Forestry & Wildfire Response (FSI / State Forest Departments): Thermal anomaly hotspot detection and post-fire burn scar perimeter mapping (e.g., Similipal Biosphere Reserve, Odisha) using NASA VIIRS 375m and Sentinel-2 SWIR.
  7. Urban Planning & Built-Up Growth (MoHUA / Smart Cities): Automated tracking of unplanned peri-urban sprawl and impervious surface fractions (e.g., Bengaluru Metropolitan Region) using Cartosat-3 and European Commission GHSL.
  8. Agricultural Drought & Moisture Stress (PMFBY / Ministry of Agriculture): Vegetation Condition Index (VCI) tracking and farm pond moisture deficit analysis (e.g., Vidarbha, Maharashtra) to prioritize drought relief.
  9. Dynamic Water Resource Monitoring (Global): On-demand extraction of lakes, rivers, reservoirs, and coastal lagoons worldwide (e.g., Ramgarh Tal, Dal Lake, Powai Lake) via real-time OpenStreetMap Overpass hydrography.

2. System Architecture

                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚         FRONTEND (Edge CDN / Browser)      β”‚
                          β”‚  public/ (Vercel CDN) & frontend/ (Local)  β”‚
                          β”‚  β€’ Leaflet.js interactive satellite map    β”‚
                          β”‚  β€’ Drag-and-drop satellite tile upload zoneβ”‚
                          β”‚  β€’ Natural language query console          β”‚
                          β”‚  β€’ Categorized preset dropdown (8 scenariosβ”‚
                          β”‚  β€’ Live NASA GIBS daily satellite toggle   β”‚
                          β”‚  β€’ Light / Dark mode theme controller      β”‚
                          β”‚  β€’ 3-Step temporal progression player      β”‚
                          β”‚  β€’ Tactical action guidance & sensor specs β”‚
                          β”‚  β€’ Interactive Provenance & AI Model Modal β”‚
                          β”‚  β€’ GeoJSON vector export & API Docs link   β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚ REST (JSON & Multipart/Form-Data)
                                              β–Ό
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚            BACKEND β€” FastAPI               β”‚
                          β”‚  backend/main.py / api/index.py (Vercel)   β”‚
                          β”‚  β€’ POST /api/v1/query                      β”‚
                          β”‚  β€’ POST /api/v1/upload-query (Tile upload) β”‚
                          β”‚  β€’ GET  /api/v1/scenarios                  β”‚
                          β”‚  β€’ GET  /api/v1/health                     β”‚
                          β”‚  β€’ GET  /api/v1/temporal/{scenario_id}     β”‚
                          β”‚  β€’ GET  /docs & /openapi.json (Swagger UI) β”‚
                          β”‚  β€’ VercelPathFixMiddleware (ASGI routing)  β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                                              β–Ό
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚    SatQueryEngine (backend/inference.py)   β”‚
                          β”‚                                            β”‚
                          β”‚   Natural Language Query / Image Tile      β”‚
                          β”‚       β”‚                                    β”‚
                          β”‚       β–Ό                                    β”‚
                          β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
                          β”‚   β”‚ NLP Semantic Classifier   β”‚            β”‚
                          β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚
                          β”‚                 β”‚                          β”‚
                          β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
                          β”‚     β–Ό           β–Ό            β–Ό             β”‚
                          β”‚ DYNAMIC API   CALIBRATED   REAL VLM MODE   β”‚
                          β”‚ (Live Feeds)  (8 Disasters)(Local GPU)     β”‚
                          β”‚     β”‚           β”‚            β”‚             β”‚
                          β”‚     β–Ό           β–Ό            β–Ό             β”‚
                          β”‚ dynamic_      spatial_     RemoteCLIP +    β”‚
                          β”‚ resolver.py   data.py      Grounding DINO  β”‚
                          β”‚               β€’ Assam      + SAM 2         β”‚
                          β”‚ β€’ OSM Overpass  Floods                     β”‚
                          β”‚ β€’ USGS Quakes β€’ Sikkim                     β”‚
                          β”‚ β€’ AWS STAC      GLOF                       β”‚
                          β”‚ β€’ GloFAS      β€’ Joshimath                  β”‚
                          β”‚   Hydro         Subsidence                 β”‚
                          β”‚               β€’ Wayanad                    β”‚
                          β”‚                 Landslides                 β”‚
                          β”‚               β€’ Manipur                    β”‚
                          β”‚                 Landslides                 β”‚
                          β”‚               β€’ Bengaluru                  β”‚
                          β”‚                 Sprawl                     β”‚
                          β”‚               β€’ Similipal                  β”‚
                          β”‚                 Wildfire                   β”‚
                          β”‚               β€’ Vidarbha                   β”‚
                          β”‚                 Drought                    β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                                              β–Ό
                                GeoJSON FeatureCollection
                       (Geometry, Practical Confidence, Area kmΒ², Specs)
                                              β”‚
                                              β–Ό
                          Rendered as interactive vector polygons
                             on Leaflet.js satellite basemap

3. Live External API Integrations

SatQuery AI connects to an ecosystem of real-time open Earth Observation and disaster monitoring APIs:

External Service Provider Purpose Endpoints / Specifications
NASA GIBS NASA EOSDIS Live Daily True-Color Satellite Imagery WMTS / EPSG:3857 MODIS Terra & VIIRS TrueColor with dynamic ISO date resolution (YYYY-MM-DD) and .jpeg format
USGS Earthquake API US Geological Survey Real-time global seismic feeds & epicenters https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson
OpenStreetMap Overpass OpenStreetMap Foundation High-precision dynamic global hydrography & water bodies https://overpass-api.de/api/interpreter (QL: natural=water, water=*)
OSM Nominatim OpenStreetMap Foundation Global geocoding & administrative boundary resolution https://nominatim.openstreetmap.org/search
Earth Search STAC Element84 / AWS Daily Sentinel-2 L2A scene granule metadata & cloud cover https://earth-search.aws.element84.com/v1 (Copernicus Sentinel-2 Collection)
GloFAS Flood API Copernicus EMS / Open-Meteo Real-time river discharge ($m^3/s$) & 7-day forecast trend https://flood-api.open-meteo.com/v1/flood

4. Operational Scenario Presets & Benchmarks

In addition to dynamic multi-API queries worldwide, SatQuery AI features eight calibrated disaster and environmental benchmarks based on official satellite activations and ground-truth telemetry:

Scenario Active Sample Query Location Sensors Core Algorithm / Model
Detect Floods "Highlight flooded regions and riverine inundation in Brahmaputra Assam" Brahmaputra Basin, Assam Sentinel-1A C-SAR (10m) / RISAT-1A Bitemporal SAR Backscatter Ratio ($\sigma^0\ \text{VV/VH}$) + Otsu Thresholding
Sikkim Flash Flood & GLOF "Detect Teesta river flash flood and South Lhonak lake GLOF in Sikkim" Teesta River Valley, Sikkim Sentinel-1A C-SAR / ISRO Cartosat-3 / Sentinel-2A Bitemporal SAR Backscatter Coherence Loss + CWC Hydrograph Surge Telemetry
Joshimath Land Subsidence "Analyze land subsidence and crack damage in Joshimath Uttarakhand" Chamoli District, Uttarakhand Sentinel-1A DInSAR / Cartosat-3 (0.28m) Multi-temporal DInSAR Phase Unwrapping (5.6cm $\lambda$) + PSInSAR Displacement Stacks
Detect Landslides "Identify landslide scars and debris flow runout in Wayanad" Wayanad, Kerala Cartosat-3 (0.28m PAN) / Sentinel-1A SAR Optical Differential Change Detection + InSAR Coherence ($\gamma < 0.25$) + DEM Slope (>34Β°)
Manipur Landslides "Map landslide debris and railway yard failure in Noney Manipur" Noney & Jiribam, Manipur ISRO Cartosat-3 / Sentinel-2A / Resourcesat-2A Bi-temporal Cartosat-3 PAN Change Detection + Coherence Loss Index + Fluvial Blocking
Track Urban Sprawl "Show urban expansion and built-up development in Bengaluru" Bengaluru Metropolitan Cartosat-3 Optical (0.28m PAN / 1.12m MX) Normalized Difference Built-Up Index ($\text{NDBI}$) + Impervious Surface Fraction
Forest Fire Hotspots "Detect active forest fire fronts and burn scars in Similipal" Similipal National Park, Odisha NASA VIIRS (375m) / Sentinel-2 MSI (20m) Thermal Anomaly ($4\mu\text{m} / 11\mu\text{m}$) + Differenced Normalized Burn Ratio ($\text{dNBR} > 0.44$)
Crop Drought Stress "Analyze crop drought moisture stress and farm ponds in Vidarbha" Vidarbha, Maharashtra Resourcesat-2A AWiFS (56m) / MODIS (250m) Vegetation Condition Index ($\text{VCI} < 25%$) + Normalized Difference Moisture Index ($\text{NDMI}$)

5. Tech Stack

  • Backend Framework: Python 3.10+, FastAPI, Uvicorn, Starlette, Pydantic v2
  • Cloud Infrastructure & Serverless: Vercel Python Runtime, Vercel Edge CDN, custom VercelPathFixMiddleware
  • Geospatial & Vector Processing: Shapely, PyProj, GeoJSON, Rasterio
  • Vision-Language & Deep Learning (Real-Mode): HuggingFace Transformers, PyTorch, OpenCLIP, Qwen2-VL, Grounding DINO, SAM 2 (Segment Anything 2)
  • Frontend & Mapping: HTML5, CSS3 (Light/Dark themes, JetBrains Mono font), Vanilla JavaScript (ES2020+), Leaflet.js
  • Satellite Basemaps: Esri World Imagery (High-Resolution Baseline) + CARTO Voyager Reference Labels + NASA EOSDIS GIBS Daily True-Color Layer

6. Installation & Setup

Option A: Local Development (Standard / Fast Setup)

Run the full platform locally with lightweight dependencies:

# 1. Clone repository
git clone https://github.com/lowkeyd3v/satquery-ai.git
cd satquery-ai

# 2. Create and activate a virtual environment
python -m venv venv
# Windows:
venv\ScriptsοΏ½ctivate
# Linux/macOS:
source venv/bin/activate

# 3. Install lightweight production requirements
pip install -r requirements.txt

# 4. Start the FastAPI development server
uvicorn backend.main:app --reload

Then open http://127.0.0.1:8000 in your browser.

Option B: Enabling GPU Real VLM Mode (Optional)

If running on a machine equipped with an NVIDIA GPU (CUDA 12+, 8GB+ VRAM):

# Install GPU and vision-language dependencies
pip install -r requirements-gpu.txt

# Set environment flags
export SATQUERY_REAL_MODE=1
export SATQUERY_VLM_MODEL="Qwen/Qwen2-VL-2B-Instruct"
export SATQUERY_SEGMENTATION_MODEL="IDEA-Research/grounding-dino-tiny"

# Start the server
uvicorn backend.main:app --reload

Note: If GPU weights cannot be fetched or VRAM is exhausted, the engine automatically falls back to deterministic multi-API geospatial generation without disrupting API uptime.

Option C: Live Production (Vercel)

The live application is hosted at:

Deploying your own fork to Vercel requires zero build configuration β€” simply connect the repository to Vercel; vercel.json and api/index.py handle all serverless routing automatically.


7. Key Features & User Interface

1. Drag-and-Drop Satellite Image Tile Upload & Query

Allow evaluators and judges to drag and drop their own arbitrary satellite imagery files (GeoTIFF, PNG, JPEG up to 50MB) directly onto the upload zone:

  • Live client-side thumbnail rendering with filename, file size formatting, and one-click clear button.
  • Auto-suggests natural-language prompts if the input box is blank.
  • Multipart form-data pipeline (POST /api/v1/upload-query) executing contextual vision-language spatial classification and vector segmentation.

2. Categorized Mission-Control Preset Selector

Replaced crowded button stacks with a sleek, categorized 40px select menu keeping all control panels, live telemetry, and map controls visible on a single screen without scrolling:

  • 🚨 Emergency & Disaster Geohazards: Assam Brahmaputra Floods, Sikkim Teesta GLOF, Joshimath Subsidence, Wayanad Landslides, Manipur Railway Landslides, Similipal Forest Fires.
  • πŸ›°οΈ Environmental & Urban Telemetry: Bengaluru Urban Sprawl, Vidarbha Crop Drought Stress.
  • Dynamic Context Card: Instantly previews the active scenario's thematic color dot, administrative region badge, sensor attribution, and operational summary.

3. Natural Language Geospatial Querying

Submit unconstrained operational queries such as:

  • "Highlight flooded regions in Assam along the Brahmaputra"
  • "Detect Teesta flash flood and South Lhonak lake GLOF in Sikkim"
  • "Analyze land subsidence and crack damage in Joshimath Uttarakhand"
  • "Identify landslide scars and debris flow runout in Wayanad"
  • "Map landslide debris and railway yard failure in Noney Manipur"
  • "Earthquakes in India" or "Water bodies in Gorakhpur"

4. Live NASA GIBS Daily Satellite Layer

Toggle daily true-color satellite imagery directly from the floating map pill. An intelligent date-resolution algorithm computes the latest completed global composite date (YYYY-MM-DD) and retrieves official WMTS .jpeg tiles across zoom levels 1–9 (overzoomed to 19 via maxNativeZoom: 9) with guaranteed zero-404 availability.

5. Light & Dark Mode Toggle

Switch instantly between the ISRO Mission Control Dark Theme and high-visibility Daylight / Clean Light Theme with seamless transitions, persisted in browser localStorage.

6. Interactive Provenance & AI Model Modal

Click "View Source & AI Model Details" on any query report to open a dedicated modal displaying:

  • STAC granule scene ID and acquisition timestamp
  • Optical / SAR sensor platform and ground sampling distance (GSD)
  • Hydrological and seismic telemetry (river discharge $m^3/s$, focal depth km, Richter magnitude)
  • Machine learning model architectures (RemoteCLIP, Grounding DINO, SAM 2, Otsu, DInSAR)
  • Official data provider links (Copernicus, ISRO, NASA, USGS, OpenStreetMap)

7. Interactive 3-Step Temporal Progression

Inspect temporal evolution across three distinct operational phases:

  • Step 1: Baseline / Detection (Initial anomaly / moraine shear / early stress)
  • Step 2: Spread / Growth (Active surge / inundation propagation / secondary failure)
  • Step 3: Peak / Post-Event (Maximum extent / valley blockage / critical deformation)

8. Downloadable / Printable Tactical PDF Intelligence Dossier (SITREP)

Generate an official operational emergency situation report with a single click:

  • Government of India / NRSC ISRO Format: Styled as an official tactical dispatch carrying dynamic security stamps (RESTRICTED // OPS), automated SITREP tracking IDs, and dual-timezone issuance stamps (IST / UTC).
  • Operational Directive & Telemetry Breakdown: Displays executive field guidance (NDRF / SDMA protocols), satellite sensor telemetry (resolution, cloud cover %, sun elevation angle), and GloFAS river discharge readings.
  • Vectorized Sector Delineation Table: Enumerates delineated geohazard sectors with geographic centroid coordinates, quantified area ($km^2$), and tactical alert status.
  • Forensic Chain-of-Custody & Electronic Signature: Cryptographically grounded via STAC Copernicus and USGS catalogs with automated audit stamps.
  • Exact 1-Page A4 Print Layout: Calibrated CSS print media stylesheets ensure perfect, zero-clipping single-page PDF output via standard browser print preview (Ctrl+P).

9. Transparent Collapsible Agentic Execution Trace

Inspect the multi-stage autonomous reasoning pipeline behind every satellite inference result:

  • Stage 1: Query Parsing & Intent Routing: Discards non-geographic action tokens, disambiguates disaster classification, and scores query confidence.
  • Stage 2: Sensor Selection & Orchestration: Determines optimal ground resolution and sensor modality (SAR vs. High-Res Optical vs. SWIR).
  • Stage 3: Vector Grounding & Spatial Segmentation: Executes model pipelines (RemoteCLIP zero-shot classification, Otsu thresholding, SAM 2 mask vectorization) and tallies polygon counts and square kilometer metrics.
  • Stage 4: Operational Emergency Directive Synthesis: Synthesizes actionable ground advisories mapped to alert severity levels (Critical / High / Moderate / Normal).
  • UI Symmetry: Built with a collapsible header preserving vertical symmetry with the map viewport.

10. Pre-Indexed Offline Indian Disaster Gazetteer & Rate-Limiting

Defensive geocoding architecture ensuring 100% operational uptime:

  • 0ms Offline Indian Gazetteer: Built-in spatial index covering all primary Indian disaster theatres (Assam Brahmaputra, Sikkim Teesta, Joshimath, Wayanad, Manipur Tupul, Similipal, Vidarbha, Punjab Satluj) and water bodies (Ramgarh Tal, Chilua Tal, Yamuna, Gomti). Queries resolve instantly with zero network dependencies.
  • Thread-Safe Rate Limiter: Enforces strict 1.05-second spacing between calls to OpenStreetMap Nominatim, preventing HTTP 429 Too Many Requests bans.
  • Self-Hosted Geocoder Support: Fully configurable via NOMINATIM_BASE_URL environment variable for on-premise Docker deployments.

11. Standard Vector & Telemetry Export

Export delineated polygons directly as .geojson for seamless drag-and-drop import into QGIS, ArcGIS, or ISRO Bhuvan. Fast clipboard access (⎘ Copy JSON) allows developers to inspect full raw GeoJSON payloads with one click.


8. API Reference

Interactive Swagger documentation is available at /docs.

Endpoints Summary

Method Endpoint Description
GET /api/v1/health Service health status and inference engine diagnostics
GET /api/v1/scenarios List of supported preset scenarios, queries, and sensor sources
POST /api/v1/query Submit natural-language query (application/json); returns GeoJSON
POST /api/v1/upload-query Submit satellite tile (multipart/form-data) + query for multimodal analysis
GET /api/v1/temporal/{scenario_id} Returns 3-step temporal GeoJSON snapshots (Detection β†’ Spread β†’ Peak)
GET /docs Interactive Swagger UI API documentation
GET /openapi.json Complete OpenAPI 3.1 specification schema

Sample POST /api/v1/query Request

curl -X POST https://satquery-ai-sage.vercel.app/api/v1/query \
  -H "Content-Type: application/json" \
  -d '{"query": "Earthquakes in India"}'

Sample POST /api/v1/upload-query Request (Image Tile Upload)

curl -X POST https://satquery-ai-sage.vercel.app/api/v1/upload-query \
  -F "query=Detect floods in this satellite image" \
  -F "file=@satellite_tile.png"

Sample Response Payload

{
  "success": true,
  "mode": "dynamic_api",
  "scenario_id": "earthquake",
  "matched_label": "Earthquakes β€” India",
  "query_confidence": 0.95,
  "processing_time_ms": 142.6,
  "message": "Resolved via live USGS Live Seismographic Network & Copernicus InSAR for India.",
  "geojson": {
    "type": "FeatureCollection",
    "name": "india_earthquake_seismic_assessment",
    "features": [
      {
        "type": "Feature",
        "id": "us7000tg4b",
        "properties": {
          "name": "M5.1 Seismic Event",
          "label": "M5.1 Earthquake Epicenter",
          "magnitude": 5.1,
          "depth_km": 10.0,
          "place": "115 km NE of Joshimath, India",
          "event_time": "2026-09-09 14:22 UTC",
          "scenario": "earthquake",
          "confidence": 0.96,
          "area_sqkm": 2042.8,
          "severity": "High",
          "sensor": "USGS Global Seismographic Network & Copernicus Sentinel-1A InSAR",
          "resolution": "Continuous Seismometric & 10m InSAR",
          "dataset": "USGS Real-Time Earthquake Feed & Copernicus InSAR",
          "methodology": "Waveform Moment Tensor Inversion + InSAR Surface Deformation Phase Mapping",
          "action": "Trigger automated advisory to Disaster Management Authorities; conduct rapid structural stability evaluation of bridges and dams along fault zone.",
          "color": "#ff1744"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [79.82, 30.85],
              [80.05, 30.98],
              [80.25, 30.82],
              [79.82, 30.85]
            ]
          ]
        }
      }
    ],
    "metadata": {
      "region": "India (Global)",
      "sensor": "USGS Global Seismographic Network & Copernicus Sentinel-1A InSAR",
      "scenario": "earthquake",
      "center": [22.97, 78.65],
      "zoom": 6,
      "dataset_source": "USGS Real-Time Earthquake Feed & Copernicus InSAR",
      "is_dynamic": true,
      "earthquake_count": 15,
      "max_magnitude": 5.1
    }
  }
}

9. Project Structure

satquery-ai/
β”œβ”€β”€ README.md                 # Master project documentation
β”œβ”€β”€ DATASETS.md               # Scientific dataset provenance, benchmarks & ground truth
β”œβ”€β”€ requirements.txt          # Production & Vercel dependencies (~25MB)
β”œβ”€β”€ requirements-gpu.txt      # GPU dependencies for real VLM / SAM 2 mode (~2.5GB)
β”œβ”€β”€ vercel.json               # Vercel serverless routing & static asset rewrite rules
β”œβ”€β”€ .githooks/                # Git pre-commit hooks (auto-syncs frontend/ β†’ public/)
β”œβ”€β”€ api/
β”‚   └── index.py              # Vercel Serverless Function entrypoint + ASGI path middleware
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ __init__.py           # Backend package initializer
β”‚   β”œβ”€β”€ main.py               # FastAPI application, API endpoints & local static server
β”‚   β”œβ”€β”€ inference.py          # SatQueryEngine: VLM pipeline & NLP semantic classifier
β”‚   β”œβ”€β”€ dynamic_resolver.py   # Multi-API resolver (Overpass, USGS, GloFAS, STAC)
β”‚   └── spatial_data.py       # Calibrated GeoJSON scenarios, contours & temporal progression
β”œβ”€β”€ frontend/                 # Local source frontend
β”‚   β”œβ”€β”€ index.html            # Dashboard markup, upload dropzone, & control panels
β”‚   β”œβ”€β”€ styles.css            # Dark/Light theme styles, responsive layout, animations
β”‚   └── app.js                # Map engine, Leaflet handlers, history & temporal animation
β”œβ”€β”€ tests/                    # Automated testing & defensive security harness
β”‚   β”œβ”€β”€ test_audit.py         # Endpoint contract, XSS, DoS & MIME validation (23 tests)
β”‚   └── test_scenarios.py     # Preset benchmarks & dynamic geocoder test suite
└── public/                   # Production CDN static assets for Vercel
    β”œβ”€β”€ index.html            # Edge CDN landing page
    └── static/
        β”œβ”€β”€ styles.css        # CDN stylesheet
        └── app.js            # CDN client script

10. Automated Testing & Defensive Security Harness

SatQuery AI includes an automated testing and security audit harness that validates endpoint contracts, boundary conditions, input sanitization, and geocoding resilience:

# Run full system feature & security audit
python tests/test_audit.py

# Run comprehensive all-scenarios & geocoder benchmark
python tests/test_scenarios.py

Audited Security Boundaries (23/23 Tests Passed)

  • XSS Sanitization: Bidirectional HTML entity encoding (escapeHtml) on all user-controlled queries, scenario labels, and metadata tags before DOM insertion.
  • MIME & Executable Filtering: Enforces strict whitelist on satellite raster uploads; automatically rejects .exe, .sh, .py, and scripts with HTTP 415.
  • Path Traversal Protection: Random UUID assignment (uuid4().hex) for all temporary upload files; strict parameter validation on /api/v1/temporal/{scenario_id}.
  • Denial of Service Limits: Enforces a 500-character ceiling on query strings and a 50 MB maximum on raster tile uploads (HTTP 413).
  • CORS Compliance: Wildcard CORS configured with allow_credentials=False for strict modern browser specification compliance.

11. License & Attribution

Developed for Smart India Hackathon 2026 under Problem Statement SIH26167 in collaboration with the Indian Space Research Organisation (ISRO). Designed for mission evaluation, authorized research, and operational prototyping.

About

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages