yantrikaran-innovations/dronacharya-recce-backend
0
Dronacharya Recce System — Backend
FastAPI GIS backend for the Dronacharya Recce System (AI-Powered Artillery Terrain Intelligence Platform). Serves district-level suitability points, vector layers, raster tiles, and mission analysis endpoints over six Indian districts: Ganganagar, Jaisalmer, Nashik, Pithoragarh, Sonitpur, Vishakhapatnam.
This Space ships backend code only. The ~4.7 GB of GIS rasters, OSM vectors, feature parquets, and model artefacts live in Cloudflare R2; the backend lazy-downloads them on first use and caches them under PS10_BASE_DIR.
Required Space variables
Required Space secrets
Endpoints
GET /api/health— health check (no R2 download)GET /api/capabilities— feature flagsGET /api/metadata— model metadata (downloads tinymodel_metadata.jsononce)GET /api/districts— list districtsGET /api/districts/{district}— district summaryGET /api/districts/{district}/candidates— top candidate gun areasGET /api/districts/{district}/suitability-points— XGBoost-scored pointsGET /api/districts/{district}/vector/{layer}— OSM vectorsGET /api/districts/{district}/layer/{layer}/tile/{z}/{x}/{y}.png— raster tiles
Lazy-loading behaviour
/api/healthdoes not touch any district data.- The first request that needs a district-specific file triggers an R2 download into the local cache (
/tmp/dronacharya-recce-assets/...). Subsequent requests are served from cache. - Per-key locks prevent concurrent duplicate downloads.
- Container restarts wipe
/tmp— first request after a restart re-downloads what it needs.
Asset layout in R2 (and local cache)
<R2 bucket>/
├── 5-PS-10_district.zip
├── district_final_rasters/{district}_final/{district}_*.tif
├── district_osm_output/{district}/{district}_osm.gpkg
├── district_osm_output/{district}/{district}_buildings.gpkg
├── xgb_features/{district}_features.parquet
├── xgb_features/{district}_dem_features.tif
├── xgb_model_output/{district}_suitability_points.parquet
├── xgb_model_output/{district}_top50_candidates.geojson
├── xgb_model_output/xgb_classifier.json
├── xgb_model_output/xgb_regressor.json
└── xgb_model_output/model_metadata.jsonLicense / data
Geospatial datasets retain their upstream licenses (OSM, ESA WorldCover, Copernicus DEM, ISRIC SoilGrids, JRC Global Surface Water). Model artefacts are property of Yantrikaran Innovations Pvt. Ltd.
