Real-time aircraft tracking and anomaly detection system for situational awareness and defense intelligence applications.
Interactive 3D visualization with altitude-based coloring and pitch/bearing controls
Real-time aircraft information with historical trajectory visualization
Spatial density analysis showing high-traffic corridors over Europe
Real-time geofence violation detection with severity classification
Platform tracking 600+ aircraft simultaneously across multiple regions
This platform demonstrates production-grade geospatial intelligence capabilities relevant to defense AI and battlefield management systems. Built as a portfolio project to showcase ML engineering, real-time data processing, and full-stack development skills.
Key Value Proposition:
- Single pane of glass for multi-source geospatial data integration
- Automated anomaly detection across 5 statistical and ML-based methods
- Real-time processing of 1,000+ aircraft with sub-second query performance
- 3D interactive visualization with 60 FPS rendering using Deck.gl
- OpenSky Network integration - 3-minute polling interval (480 requests/day)
- Live updates via RESTful API with spatial filtering
- Historical trajectories with path visualization
Five complementary detection methods:
- Speed anomalies - Z-score statistical outliers (threshold: 2.5Ο)
- Altitude anomalies - IQR-based detection for unusual flight levels
- Geofence violations - Spatial boundary checks (5 restricted zones)
- Clustering anomalies - DBSCAN isolation of spatial outliers
- ML-based detection - Isolation Forest for multivariate patterns
Current metrics: ~100 active alerts with severity classification (HIGH/MEDIUM/LOW)
- Deck.gl + MapBox GL - Hardware-accelerated WebGL rendering
- 3D perspective mode - Adjustable pitch (0-60Β°) and bearing (0-360Β°)
- Altitude-based coloring:
- π΄ Red: >10,000m (high altitude)
- π‘ Orange: 5,000-10,000m (cruising)
- π΅ Blue: <5,000m (low altitude)
- βͺ Gray: Ground/unknown
- Layer controls:
- Aircraft points (real-time positions)
- Trajectories (historical paths)
- Density heatmap (H3 hexagonal aggregation)
- H3 hexagonal indexing (Uber H3) - Multi-resolution spatial indexing
- PostGIS spatial queries - Sub-100ms bounding box queries
- Density heatmap - Activity aggregation by geographic cells
- Spatial filtering - Real-time viewport-based data loading
FastAPI 0.109.0 # REST API framework
PostgreSQL 15 # Primary database (via Docker)
PostGIS 3.3 # Geospatial extension
SQLAlchemy 2.0.45 # ORM
GeoAlchemy2 0.14.3 # PostGIS integration
Shapely 2.0.2 # Geometric operations
H3 4.4.1 # Hexagonal indexing (Uber H3)
GeoPandas 0.14.2 # Geospatial data analysis
scikit-learn 1.4.0 # Anomaly detection (Isolation Forest, DBSCAN)
APScheduler 3.10.4 # Job scheduling (OpenSky polling)
aiohttp 3.9.1 # Async HTTP client
psycopg 3.1.18 # PostgreSQL driver
React 18.2 # UI framework
TypeScript 5.0 # Type safety
Deck.gl 8.9 # 3D geospatial visualization
MapBox GL 2.15 # Base map tiles
Material-UI 5.14 # Component library
Axios 1.6 # HTTP client
Zustand 4.4 # State management
Docker / Docker Compose
PostgreSQL 15 + PostGIS 3.3 (official postgis/postgis image)
Redis 7 Alpine (caching - optional, planned)
Note: Current Docker Compose provides database services only. Backend and frontend run locally during development. Production containerization is on the roadmap.
- Docker Desktop (for PostgreSQL + PostGIS)
- Python 3.12.1 (backend)
- Node.js 18+ (frontend)
- 8GB+ RAM recommended
- Git
- Clone repository
git clone https://github.com/Fredbcx/geospatial-intelligence-platform.git
cd geospatial-intelligence-platform- Start database services
# Start PostgreSQL + PostGIS and Redis
docker-compose up -d
# Verify services are running
docker ps
# Should show: geoint-postgis, geoint-redis- Setup backend
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your settings:
# OPENSKY_USERNAME=your_username (optional, for higher rate limits)
# OPENSKY_PASSWORD=your_password
# DATABASE_URL=postgresql://geoint:password@localhost:5432/geoint
# Run database migrations (creates tables, indexes)
python database.py
# Start backend server
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000- Setup frontend (in new terminal)
cd frontend
# Install dependencies
npm install
# Configure MapBox token
cp .env.local.example .env.local
# Edit .env.local and add your MapBox token:
# VITE_API_URL=http://localhost:8000
# VITE_MAPBOX_TOKEN=your_mapbox_token_here
#
# Get free token at: https://account.mapbox.com/access-tokens/
# Start development server
npm run dev- Verify deployment
- Backend API: http://localhost:8000/docs (Swagger UI)
- Frontend: http://localhost:5173
- Database: localhost:5432 (user: geoint, password: password)
The system will automatically:
- β Initialize PostgreSQL with PostGIS extension
- β Create database schema (aircraft, positions, alerts tables)
- β Create spatial indexes (GIST on geometry columns)
- β Start OpenSky data ingestion (3-minute intervals)
- β Generate anomaly alerts
Initial data population: ~10-15 minutes to reach 1,000+ aircraft
If OpenSky Network is unavailable or you want instant data:
cd backend
# Populate database with 100 realistic test aircraft (with trajectories)
python populate_test_data_with_trajectory.py
# This generates:
# - 100 aircraft with realistic positions over Europe
# - Historical trajectory data (24h simulated flight paths)
# - Anomaly alerts based on test dataββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA SOURCES (External APIs) β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β OpenSky β β Future β β Future β β
β β Network β β Weather β β Events β β
β β (Aircraft) β β APIs β β (GDELT) β β
β ββββββββ¬βββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND (FastAPI + Python) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Data Ingestion Layer β β
β β β’ APScheduler (3-min intervals) β β
β β β’ API polling with retry logic β β
β β β’ Data validation (Pydantic) β β
β ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Geospatial Processing Engine β β
β β β’ H3 hexagonal indexing β β
β β β’ Shapely geometric operations β β
β β β’ PostGIS spatial queries β β
β ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Anomaly Detection Engine β β
β β β’ Z-score (speed) β β
β β β’ IQR (altitude) β β
β β β’ Geofence (spatial) β β
β β β’ DBSCAN clustering β β
β β β’ Isolation Forest (ML) β β
β ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β REST API Layer β β
β β β’ /api/aircraft (spatial queries) β β
β β β’ /api/alerts (anomaly management) β β
β β β’ /api/trajectories (historical paths) β β
β β β’ /api/heatmap (density aggregation) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATABASE (PostgreSQL + PostGIS) β
β Tables: β
β β’ aircraft β
β β’ aircraft_positions β
β β’ alerts β
β β’ geofences β
β β
β Indexes: β
β β’ GIST spatial indexes on all geometry columns β
β β’ B-tree on timestamps for temporal queries β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (React + Deck.gl) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 3D Map Component (Deck.gl) β β
β β β’ ScatterplotLayer (aircraft points) β β
β β β’ PathLayer (trajectories) β β
β β β’ HexagonLayer (density heatmap) β β
β β β’ MapBox GL (dark-v11 tiles) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Control Panels β β
β β β’ View controls (2D/3D, pitch, bearing) β β
β β β’ Layer toggles β β
β β β’ Alert management β β
β β β’ Aircraft details β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Real-time Pipeline:
OpenSky API β FastAPI endpoint β Data validation β
PostGIS insertion β Anomaly detection β Alert generation β
Frontend query β Deck.gl rendering (60 FPS)
Query Optimization:
- Spatial indexes (GIST) reduce query time from ~2s to <100ms
- Viewport filtering limits data transfer (1,000 aircraft max per request)
- H3 indexing enables O(1) spatial lookups
- Spatial queries: <100ms (bounding box with 1,000 results)
- Trajectory queries: <50ms (single aircraft, 24h history)
- Alert queries: <30ms (filtered by severity/type)
- Heatmap aggregation: <200ms (H3 density calculation)
- Frame rate: 60 FPS sustained with 1,000+ aircraft points
- 3D mode: Smooth pitch/bearing adjustments (<16ms per frame)
- Layer toggling: Instant (<16ms)
- Initial load: <2s (Docker localhost environment)
- Spatial index efficiency: 95%+ queries use index-only scans
- Query planning: PostGIS GIST indexes reduce lookup from O(n) to O(log n)
- Concurrent connections: Handles 50+ simultaneous API requests
- Tested with: 21,000+ aircraft, 180,000+ position records
- Memory usage: ~150MB database (with indexes ~25MB)
- API throughput: 100+ requests/second (single uvicorn worker)
geospatial-intelligence-platform/
βββ backend/
β βββ anomaly_detection.py # 5 detection algorithms
β βββ clean_db.py # Database cleanup utility
β βββ crud.py # Database operations
β βββ data_ingestion.py # OpenSky API integration
β βββ database.py # SQLAlchemy setup
β βββ main.py # FastAPI application + endpoints
β βββ models.py # SQLAlchemy models
β βββ scheduler.py # APScheduler (OpenSky polling)
β βββ schema.py # Pydantic validation schemas
β βββ spatial_queries.py # PostGIS query helpers
β βββ test_opensky.py # OpenSky API tester
β βββ populate_test_data_with_trajectory.py # Test data generator
β βββ requirements.txt
β βββ .env.example
β βββ .env
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ MapView.tsx # Main Deck.gl component
β β β βββ ViewControls.tsx # 3D controls (pitch/bearing)
β β β βββ AlertPanel.tsx # Alert management UI
β β β βββ FloatingAlertButton.tsx
β β β βββ ...
β β βββ hooks/
β β β βββ useAircraftData.ts # Aircraft data fetching
β β β βββ useAlerts.ts # Alert management
β β βββ services/
β β β βββ api.ts # Axios HTTP client
β β βββ ...
β βββ public/ # Static assets
β βββ ...
β βββ .env.local # Environment vars (gitignored)
β βββ .gitignore # Git ignore rules
βββ docs/
β βββ screenshots/ # Portfolio screenshots
β βββ ...
βββ docker-compose.yml # PostgreSQL + Redis only
βββ README.md
# Backend (auto-reload on code changes)
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Frontend (hot module replacement)
cd frontend
npm run dev# Clean database (remove all data)
cd backend
python clean_db.py
# Populate with test data
python populate_test_data_with_trajectory.py
# Direct database access
docker exec -it geoint-postgis psql -U geoint -d geointAccess interactive Swagger UI at http://localhost:8000/docs after starting the backend.
Key endpoints:
GET /api/aircraft- Query aircraft by bounding boxGET /api/aircraft/{icao24}/trajectory- Get flight pathGET /api/alerts- List active alerts with filtersPOST /api/alerts/{id}/acknowledge- Acknowledge alertGET /api/heatmap/density- Get H3 aggregated density data
This system demonstrates capabilities directly applicable to:
-
Battlefield Management
- Real-time asset tracking (ground vehicles, aircraft, drones)
- Multi-sensor data fusion
- Spatial anomaly detection for threat assessment
-
Border Surveillance
- Geofence violation alerts (restricted airspace)
- Pattern-of-life analysis (trajectory clustering)
- Automated threat classification
-
Maritime Domain Awareness
- Ship tracking (AIS integration - planned)
- Fishing vessel behavior analysis
- Port activity monitoring
-
Critical Infrastructure Protection
- Perimeter security (geofence alerts)
- Unauthorized drone detection
- Proximity warnings for sensitive facilities
- Airline Operations: Flight delay prediction, route optimization
- Logistics: Fleet management, delivery tracking
- Smart Cities: Traffic flow analysis, urban planning
- Environmental Monitoring: Emissions tracking, noise pollution
- AIS ship tracking integration (MarineTraffic API)
- Weather data overlay (OpenWeatherMap)
- GDELT event correlation (geopolitical events)
- Satellite imagery integration (background context)
- Predictive trajectory modeling (LSTM neural networks)
- Collision detection (proximity warnings)
- Pattern-of-life analysis (behavioral clustering)
- Temporal correlation (event-driven anomalies)
- WebSocket real-time updates (sub-second latency)
- User authentication (JWT-based)
- Alert rule builder (custom geofences, conditions)
- Report generation (PDF exports, analytics)
- Mobile-responsive design
- Reinforcement learning for adaptive alerting
- Graph neural networks for trajectory prediction
- Automated threat classification (supervised learning)
- Federated learning for privacy-preserving analytics
- Docker multi-service setup (currently only database; add backend + frontend containers)
- Redis caching implementation (reduce PostgreSQL load)
- Nginx reverse proxy (load balancing, SSL termination)
- Prometheus + Grafana (monitoring dashboards)
- CI/CD pipeline (GitHub Actions for automated testing/deployment)
- Kubernetes deployment (production-grade orchestration)
This project draws on concepts from:
This is a portfolio project, but feedback and suggestions are welcome!
MIT License - see LICENSE file for details.
- OpenSky Network for free aircraft tracking data
- MapBox for beautiful map tiles
- Uber H3 for hexagonal indexing technology
- Deck.gl Team for exceptional WebGL visualization library