GeoMind transforms open geospatial data β satellite imagery, OpenStreetMap, elevation models, and live camera feeds β into structured, queryable, actionable intelligence through developer-friendly APIs.
Make geographic intelligence accessible through simple APIs and scalable infrastructure β no GIS expertise required.
Extract real-world metrics around any coordinate:
| Metric | Description | Unit |
|---|---|---|
| Building Density | Footprint area Γ· analysis area | ratio (0β1) |
| Road Density | Total road length Γ· area | km/kmΒ² |
| Vegetation Coverage | Vegetated land Γ· area | ratio (0β1) |
| Water Proximity | Distance to nearest water + coverage | meters + ratio |
| Elevation | Center + ring samples (min/max/mean) | meters |
Data sources: OpenStreetMap (via Overpass API), SRTM elevation (OpenTopoData/Open-Elevation)
Provenance: Every response includes source metadata, cache status, timestamps, and licenses (ODbL, public domain).
curl "http://localhost:8000/api/v1/location-intelligence?lat=52.52&lon=13.405&radius_m=500"Ingest live MJPEG/JPEG feeds, deduplicate, and serve latest frames.
| Feature | Details |
|---|---|
| Multi-feed | Configure N cameras with individual intervals |
| Deduplication | Perceptual hash (pHash) β skips visually identical frames |
| Scheduling | APScheduler with per-feed intervals + exponential backoff retries |
| Storage | Files organized by camera_id/YYYYMMDD_HHMMSS_NNNNNN.jpg |
| Persistence | Async SQLAlchemy (PostgreSQL/SQLite) for frame metadata |
| API | Health, list, latest frame (JSON + JPEG), manual trigger |
Config (cameras.yaml):
feeds:
- feed_url: "https://images.webcams.travel/api/cam/1471069946/image.jpg"
camera_id: "nyc_times_square"
fetch_interval_seconds: 30
timeout_seconds: 10
max_retries: 3Real-time smoke and fire detection from camera frames using ONNX Runtime.
| Feature | Details |
|---|---|
| Model | ONNX Runtime (YOLO-style) with custom wildfire classes (smoke=0, fire=1) |
| Temporal Validation | Requires N consecutive frames (default 3) with confidence threshold |
| Detection States | pending β confirmed / rejected |
| Queue | Async frame processing with configurable workers & batch size |
| Storage | SQLite/PostgreSQL for detection events & confirmed incidents |
| API | List events, latest per camera, real-time WebSocket streaming |
Config (vision.yaml):
model:
type: "onnx" # dummy, yolo, wildfire, onnx, onnxruntime
weights_path: "./models/wildfire_yolov8n.onnx"
device: "cpu" # cpu, cuda, mps
confidence_threshold: 0.25
iou_threshold: 0.45
input_size: 640
classes: [0, 1] # smoke, fire
temporal:
min_consecutive_frames: 3
frame_confidence_threshold: 0.3
max_frame_gap_seconds: 60.0JWT + API Key authentication with Role-Based Access Control.
| Feature | Details |
|---|---|
| JWT | Access (15m) + Refresh (7d) tokens, HS256 |
| API Keys | Hashed storage, per-key rate limits, expiration |
| Roles | admin, user, viewer, service |
| Rate Limiting | Token bucket (per-minute + per-hour) by IP / API key / Bearer token |
| Endpoints | Login, refresh, logout, register, user management, API key CRUD |
Pub/Sub for live detection events and camera status.
| Channel | Events |
|---|---|
detections |
All detection events (pending + confirmed) |
detections:confirmed |
Only temporally validated detections |
detections:pending |
Pending detections awaiting confirmation |
cameras |
Camera status updates (active, error, fps) |
system |
System notifications |
Features: JWT/API key auth, channel subscriptions with filters (camera_id, class_name, min_confidence), heartbeat/ping-pong, auto-reconnect.
| Component | Details |
|---|---|
| Prometheus | /metrics endpoint with 50+ custom metrics |
| Grafana | Pre-built dashboard (16 panels) |
| Alerting | 25+ alert rules (API, DB, cache, vision, auth, business) |
| Recording Rules | Pre-computed percentiles, rates, ratios |
| Health | /health (liveness), /health/ready (readiness) |
git clone https://github.com/VarunGore36/GeoMind
cd GeoMind
# Start PostGIS + Redis + API
docker-compose up -d
# API at http://localhost:8000
# Docs at http://localhost:8000/docs
# Dev server (hot reload) at http://localhost:8001# Install with all extras
pip install -e ".[camera,vision,auth,dev]"
# Copy config templates
cp cameras.yaml.example cameras.yaml
cp vision.yaml.example vision.yaml
cp auth.yaml.example auth.yaml
cp metrics.yaml.example metrics.yaml
# Edit configs with your settings
# ...
# Run
GEOMIND_CAM_CONFIG_PATH=cameras.yaml python -m src.geomind.main| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/location-intelligence |
Extract features around a point |
| Query params | lat, lon, radius_m (optional), refresh (optional) |
WGS84 coords, radius in meters |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/cameras/health |
All cameras status + frame counts |
GET |
/api/v1/cameras |
List configured cameras |
GET |
/api/v1/cameras/{id} |
Single camera status |
GET |
/api/v1/cameras/{id}/latest |
Latest frame metadata |
GET |
/api/v1/cameras/{id}/latest/image |
Latest frame as JPEG |
POST |
/api/v1/cameras/{id}/fetch |
Trigger immediate fetch |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/vision/events |
List detection events (paginated, filterable) |
GET |
/api/v1/vision/events/latest/{camera_id} |
Latest event for camera |
GET |
/api/v1/vision/health |
Vision engine health |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/login |
Get access + refresh tokens |
POST |
/api/v1/auth/refresh |
Refresh access token |
POST |
/api/v1/auth/logout |
Invalidate tokens |
POST |
/api/v1/auth/register |
Register new user |
GET |
/api/v1/auth/users |
List users (admin) |
GET |
/api/v1/auth/users/{id} |
Get user |
PATCH |
/api/v1/auth/users/{id} |
Update user |
DELETE |
/api/v1/auth/users/{id} |
Delete user |
POST |
/api/v1/auth/api-keys |
Create API key |
GET |
/api/v1/auth/api-keys |
List API keys |
DELETE |
/api/v1/auth/api-keys/{id} |
Revoke API key |
| Method | Endpoint | Description |
|---|---|---|
WS |
/ws/connect |
WebSocket connection endpoint |
GET |
/api/v1/ws/stats |
Connection statistics |
GET |
/api/v1/ws/channels |
Active channels + subscriber counts |
GET |
/api/v1/ws/connections |
List connections (admin) |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Liveness probe |
GET |
/health/ready |
Readiness (DB + PostGIS) |
GET |
/ |
Service metadata |
GET |
/metrics |
Prometheus metrics |
Location Intelligence:
{
"query": { "latitude": 52.52, "longitude": 13.405, "radius_m": 500, "area_m2": 785398 },
"features": {
"building_density": { "value": 0.21, "building_count": 244, "footprint_area_m2": 164983 },
"road_density": { "value": 57.3, "unit": "km/km2", "road_length_m": 44970 },
"vegetation_coverage": { "value": 0.26, "vegetation_area_m2": 208049 },
"water_proximity": { "nearest_distance_m": 125, "water_coverage_ratio": 0.056 },
"elevation": { "value": 49, "min_m": 33, "max_m": 58, "mean_m": 44.2, "samples": 5 }
},
"provenance": {
"sources": [
{ "name": "OpenStreetMap", "license": "ODbL-1.0" },
{ "name": "Elevation", "dataset": "srtm30m", "license": "Public domain" }
],
"cache": { "hit": false, "ttl_s": 86400 }
}
}βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GeoMind API β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ€
β Location Intelligence β Camera Pipeline β
β βββββββββββββββββββββββββ β ββββββββββββββββββββ β
β Overpass API (OSM) βββββΆ β Camera Feeds (MJPEG/JPEG) β
β OpenTopoData (SRTM) βββββΆ β ββββββββββββββββββββ β
β βββββββββββββββββββββββββ β APScheduler βββββ Intervals β
β PostGIS (metrics) β ββββββββββββββββββββ β
β βββββββββββββββββββββββββ β Fetcher (HTTP + Retry) β
β FastAPI /v1/location-intel β ββββββββββββββββββββ β
β β pHash Dedup β
β β ββββββββββββββββββββ β
β β Files + Postgres β
β β ββββββββββββββββββββ β
β β FastAPI /v1/cameras β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ€
β Vision Engine β WebSocket / Auth / Monitoring β
β βββββββββββββββββββββββββ β βββββββββββββββββββββββββ β
β ONNX Runtime (YOLO) β JWT + API Keys (RBAC) β
β Temporal Validation (N=3) β Token Bucket Rate Limiting β
β SQLite/Postgres Events β WebSocket Pub/Sub β
β βββββββββββββββββββββββββ β Prometheus /metrics β
β FastAPI /v1/vision β Grafana Dashboards β
β β Alerting Rules β
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
- Async throughout β FastAPI + asyncpg + SQLAlchemy 2.0
- PostGIS β spatial indexes, UTM projection for accurate metrics
- Caching β 24h TTL for OSM coverage areas, Redis for camera frames
- Deduplication β 64-bit perceptual hash, β₯95% similarity skips save
- Multi-stage Docker β minimal runtime image (~150MB), dev image with hot reload
All settings via environment variables (GEOMIND_ prefix) or YAML:
| File | Purpose |
|---|---|
.env |
Runtime overrides (DB URL, API keys, log level) |
cameras.yaml |
Camera feeds, storage, database, Redis |
vision.yaml |
Vision engine, model, temporal validation |
auth.yaml |
JWT, API keys, rate limiting, RBAC |
metrics.yaml |
Prometheus metrics config |
pyproject.toml |
Dependencies, tool config (ruff, mypy, pytest) |
Key env vars:
GEOMIND_DATABASE_URL=postgresql+asyncpg://user:pass@host/db
GEOMIND_CAM_REDIS__URL=redis://localhost:6379/0
GEOMIND_VISION_MODEL__TYPE=onnx
GEOMIND_VISION_MODEL__WEIGHTS_PATH=./models/wildfire_yolov8n.onnx
GEOMIND_AUTH_JWT_SECRET=your-secret
GEOMIND_LOG_LEVEL=INFO# All tests (154 passing)
make test
# Camera tests only
make test-cam
# Vision tests only
make test-vision
# With coverage
pytest --cov=src --cov-report=html
# Integration tests (requires PostGIS)
GEOMIND_TEST_DATABASE_URL=postgresql+asyncpg://... pytest tests/integration/Test breakdown:
- 36 unit/integration tests for Location Intelligence
- 18 camera pipeline tests (config, storage, fetcher, DB, API, scheduler)
- Vision engine tests (model, temporal validation, database, API)
- Auth tests (JWT, API keys, RBAC, rate limiting)
- WebSocket tests (manager, models, API)
- Metrics tests (collector, middleware)
# docker-compose.yml services:
# db - postgis/postgis:16-3.4 (PostGIS 3.4)
# redis - redis:7-alpine (for camera caching)
# api - geomind:latest (FastAPI + Uvicorn, 4 workers)
# api-dev - geomind:dev (hot reload on port 8001)docker-compose up -d # Start production
docker-compose up -d api-dev # Start dev server
docker-compose logs -f api # View logs
docker-compose down # StopMulti-stage build targets:
runtimeβ minimal production image (~150MB)devβ development image with pytest, ruff, mypybuilderβ dependency compilation stage
GeoMind/
βββ src/geomind/
β βββ cameras/ # Camera pipeline module
β β βββ config.py # Pydantic config models
β β βββ models.py # SQLAlchemy + Pydantic models
β β βββ storage.py # File storage + pHash dedup
β β βββ fetcher.py # HTTP fetcher with retries
β β βββ database.py # Async SQLAlchemy CRUD
β β βββ scheduler.py # APScheduler orchestration
β β βββ api.py # FastAPI routes
β β βββ README.md # Module docs
β βββ vision/ # Vision engine module
β β βββ config.py # Model, temporal, queue config
β β βββ models.py # Detection events, frames
β β βββ models_impl.py # ONNX, YOLO, Wildfire, Dummy models
β β βββ interfaces.py # Model protocols
β β βββ engine.py # Async inference engine
β β βββ temporal.py # Temporal validation logic
β β βββ database.py # Event storage
β β βββ api.py # FastAPI routes
β β βββ README.md # Module docs
β βββ auth/ # Authentication module
β β βββ models.py # User, API key, role models
β β βββ database.py # User/key storage
β β βββ utils.py # JWT, hashing, tokens
β β βββ dependencies.py # FastAPI auth deps
β β βββ rate_limit.py # Token bucket rate limiting
β β βββ api.py # Auth routes
β β βββ README.md # Module docs
β βββ ws/ # WebSocket module
β β βββ models.py # WS message models
β β βββ manager.py # Connection manager + pub/sub
β β βββ api.py # WS endpoint + publishing
β β βββ config.py # WS config
β β βββ README.md # Module docs
β βββ metrics/ # Prometheus metrics
β β βββ collector.py # Custom metrics
β β βββ middleware.py # Request metrics middleware
β β βββ README.md # Module docs
β βββ core/ # Config, errors, logging
β βββ db/ # Base, session, engine proxy
β βββ providers/ # Overpass, Elevation
β βββ repositories/ # PostGIS metric queries
β βββ services/ # Ingestion, metrics, orchestration
β βββ api/ # Health, Location Intelligence routes
β βββ main.py # FastAPI app factory
βββ geomind_client/ # Python client library
β βββ client.py # Sync + Async clients
β βββ models.py # Pydantic response models
β βββ pyproject.toml # Package config
β βββ README.md # Client docs
βββ scripts/ # Utility scripts
β βββ download_model.py # Model download + placeholder
β βββ train_wildfire.py # Training pipeline scaffold
β βββ validate_model.py # ONNX model validation
β βββ satellite_ingest.py # Sentinel-2/Landsat ingestion
β βββ generate_openapi.py # OpenAPI spec generation
βββ examples/ # Usage examples
β βββ ws_client.py # Python WS client
β βββ ws_client.js # Node.js/Browser WS client
β βββ ws_client.html # Browser demo
βββ monitoring/ # Observability configs
β βββ prometheus_alerts.yml # 25+ alert rules
β βββ prometheus_recording_rules.yml # Recording rules
β βββ grafana_dashboard.json # 16-panel dashboard
βββ tests/ # 154 tests (unit + integration)
βββ alembic/ # DB migrations
βββ data/ # Training data (gitignored)
βββ models/ # Model weights (gitignored)
βββ frames/ # Camera frames (gitignored)
βββ cameras.yaml # Camera config (gitignored)
βββ vision.yaml # Vision config (gitignored)
βββ auth.yaml # Auth config (gitignored)
βββ metrics.yaml # Metrics config (gitignored)
βββ docker-compose.yml
βββ Dockerfile
βββ Makefile
βββ pyproject.toml
βββ requirements.txt
βββ CHANGELOG.md
βββ LICENSE (MIT)
| Script | Purpose |
|---|---|
scripts/download_model.py |
Download/convert YOLO models, create ONNX placeholders |
scripts/train_wildfire.py |
Training pipeline scaffold (prepare, train, export, validate) |
scripts/validate_model.py |
Validate ONNX models + benchmark + Vision Engine integration test |
scripts/satellite_ingest.py |
Sentinel-2/Landsat search, download, indices (NDVI, NBR, NDWI...) |
scripts/generate_openapi.py |
Generate OpenAPI 3.1 spec (JSON/YAML) with filtering |
examples/ws_client.py |
Python async WebSocket client with auth, filters, reconnection |
examples/ws_client.js |
Universal JS/Node.js WebSocket client |
examples/ws_client.html |
Browser demo (vanilla JS, no deps) |
# Format & lint
make format
make lint
# Run tests
make test
# Type check
make typecheck
# Submit PRCode style: ruff (line-length 100), type hints required (mypy).
CI: GitHub Actions (lint, unit tests, integration tests, Docker build, security scan).
MIT License β see LICENSE.
Varun Gore β @VarunGore36
Built with FastAPI, PostGIS, ONNX Runtime, and open geospatial data.