Skip to content

About

Threshold - Urban Development & Service Gap Analysis Platform Threshold is a comprehensive geospatial analysis platform that combines satellite remote sensing, machine learning, and real-time data processing to identify optimal locations for urban development and analyze service accessibility gaps.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ Threshold - Urban Development & Service Gap Analysis Platform

Demo Video = https://www.youtube.com/watch?v=4w99ah-wVQk

Threshold is a comprehensive geospatial analysis platform that combines satellite remote sensing, machine learning, and real-time data processing to identify optimal locations for urban development and analyze service accessibility gaps. Built for the NASA Space Apps Challenge, this platform empowers urban planners with data-driven insights for sustainable city development.

๐ŸŽฏ Project Overview

Threshold addresses critical urban planning challenges by providing:

  • ๐Ÿ  Housing Development Hotspots: Identifies prime vacant land suitable for residential development
  • ๐Ÿฅ Service Gap Analysis: Analyzes accessibility to essential services (healthcare, parks, food, transport)
  • ๐ŸŒก๏ธ Environmental Monitoring: Real-time satellite data visualization for LST, NDVI, and air quality
  • ๐Ÿค– ML-Powered Scoring: Custom machine learning model for hotspot prediction
  • ๐Ÿ“Š Real-time Analytics: Live data processing and visualization

AQI Calculation

PM 2.5 + PM 10+ NO2 + SO2 + CO = AQI


AQI = [(Ihigh โˆ’ Ilow) / (Chigh โˆ’ Clow)] ร— (C โˆ’ Clow) + Ilow

๐Ÿ—๏ธ System Architecture

Architecture Diagrams/ Process Flow

Application Screenshots


๐Ÿ›ฐ๏ธ Satellite Data & Remote Sensing

ESA WorldCover Dataset

  • Dataset: ESA WorldCover v200 (2021)
  • Resolution: 10 meters
  • Coverage: Global land cover mapping
  • Platform: Sentinel-1 and Sentinel-2 satellites
  • Processing: Google Earth Engine integration
  • Land Cover Classes: 11 classes (Tree cover, Shrubland, Grassland, Cropland, Built-up, Bare/sparse vegetation, Snow/ice, Water bodies, Wetland, Mangroves, Moss/lichen)
  • Primary Focus: Class 60 (Bare/sparse vegetation) for vacant land detection

NASA GIBS Satellite Layers

๐ŸŒก๏ธ Land Surface Temperature (LST)

  • Satellite: MODIS Terra
  • Dataset: MODIS_Terra_Land_Surface_Temp_Day
  • Resolution: 1 km (GoogleMapsCompatible_Level7)
  • Temporal: Daily
  • Usage: Heat island analysis, climate monitoring

๐ŸŒฑ Normalized Difference Vegetation Index (NDVI)

  • Satellite: MODIS Terra
  • Dataset: MODIS_Terra_NDVI_8Day
  • Resolution: 250m (GoogleMapsCompatible_Level9)
  • Temporal: 8-day composite
  • Usage: Vegetation health, urban green space analysis

๐ŸŒซ๏ธ Air Quality Layers

  • Carbon Monoxide: AIRS L3 (500hPa, 2km resolution)
  • Aerosol Optical Depth: MODIS Aqua (3km resolution)
  • Ozone: OMI Total Column (Level 6)
  • Nitrogen Dioxide: OMI Tropospheric Column (Level 6)
  • Sulfur Dioxide: OMI Planetary Boundary Layer (Level 6)
  • PM2.5/PM10: MERRA2 Dust Surface Mass Concentration (Monthly)

๐Ÿค– Machine Learning & Custom Dataset

Custom Hotspot Scoring Dataset

Our platform features a unique, synthetic dataset specifically designed for urban hotspot analysis:

Dataset Specifications

  • Size: 15,000 samples
  • Features: 8 input variables
  • Target: Hotspot Score (0.0 - 1.0)
  • Generation: Sophisticated correlation modeling based on real urban planning principles

Input Features

  1. AQI (Air Quality Index): 0-500 scale
  2. Population Density: People per kmยฒ
  3. Distance to Hospital: km
  4. Distance to School: km
  5. Distance to Airport: km
  6. Distance to Bus Station: km
  7. Distance to Railway: km
  8. Distance to Mall: km

Advanced Scoring Algorithm

# Sophisticated scoring with area type correlation
def calculate_advanced_hotspot_score(aqi, pop_density, distances, area_type):
    # Environmental factor (40% weight)
    env_score = calculate_environmental_score(aqi)
    
    # Accessibility factor (35% weight)  
    access_score = calculate_accessibility_score(distances)
    
    # Population factor (25% weight)
    pop_score = calculate_population_score(pop_density, area_type)
    
    # Area-specific adjustments
    area_multiplier = get_area_multiplier(area_type)
    
    return weighted_combination(env_score, access_score, pop_score, area_multiplier)

Machine Learning Model

  • Algorithm: Random Forest Regressor (optimized via GridSearchCV)
  • Performance: Rยฒ > 0.95, RMSE < 0.05
  • Features: StandardScaler preprocessing
  • Deployment: Real-time inference with fallback scoring
  • Files: hotspot_model.pkl, scaler.pkl

๐ŸŒฌ๏ธ Air Quality Index (AQI) Calculation

Real-time AQI Processing

  • Data Source: Open-Meteo Air Quality API
  • Standards: EPA AQI breakpoints
  • Pollutants: PM2.5, PM10, Oโ‚ƒ, NOโ‚‚, SOโ‚‚, CO
  • Calculation: Real-time conversion from ฮผg/mยณ to AQI scale
  • Temporal: 8-hour rolling averages for Oโ‚ƒ and CO

AQI Calculation Process

# EPA-compliant AQI calculation
def calculate_aqi(concentration, pollutant):
    # Apply EPA breakpoints
    for c_low, c_high, i_low, i_high in AQI_BREAKPOINTS[pollutant]:
        if c_low <= concentration <= c_high:
            return ((i_high - i_low) / (c_high - c_low)) * (concentration - c_low) + i_low

Unit Conversions

  • Oโ‚ƒ: ฮผg/mยณ โ†’ ppb (ร—0.5)
  • NOโ‚‚: ฮผg/mยณ โ†’ ppb (ร—0.532)
  • SOโ‚‚: ฮผg/mยณ โ†’ ppb (ร—0.382)

๐Ÿ™๏ธ Service Gap Analysis

Service Categories

  1. ๐ŸŒณ Parks & Recreation: Parks, playgrounds, recreational facilities
  2. ๐Ÿ›’ Food Access: Supermarkets, grocery stores, restaurants
  3. ๐Ÿฅ Healthcare: Hospitals, clinics, pharmacies
  4. ๐ŸšŒ Public Transport: Bus stations, train stations, airports

Distance Thresholds (Urban Planning Standards)

  • Parks: Good (โ‰ค0.8km), Fair (โ‰ค2.0km), Poor (>5.0km)
  • Food: Good (โ‰ค1.5km), Fair (โ‰ค5.0km), Poor (>10.0km)
  • Healthcare: Good (โ‰ค3.0km), Fair (โ‰ค10.0km), Poor (>20.0km)
  • Transport: Good (โ‰ค0.5km), Fair (โ‰ค1.5km), Poor (>3.0km)

Data Sources

  • Primary: Google Places API (20+ place types per service)
  • Fallback: OpenStreetMap Overpass API
  • Distance: Google Distance Matrix API + Haversine fallback

๐Ÿ› ๏ธ Technical Stack

Backend (FastAPI)

# Core Technologies
FastAPI 0.104.1          # High-performance web framework
Motor 3.3.2              # Async MongoDB driver  
Google Earth Engine      # Satellite data processing
Pydantic 2.5.0          # Data validation
Scikit-learn 1.3.0      # Machine learning
Pandas 2.0+             # Data processing
NumPy 1.24+             # Numerical computing

Frontend (React + TypeScript)

// Core Technologies
React 19.1.1            // UI framework
TypeScript 5.8.3        // Type safety
Google Maps API         // Interactive mapping
Google Map React 2.2.5  // React integration
Vite 7.1.6             // Build tool
TailwindCSS 4.1.13     // Styling

Database & Infrastructure

  • Database: MongoDB (geospatial indexing)
  • Authentication: JWT with bcrypt hashing
  • APIs: RESTful with OpenAPI documentation
  • Deployment: Docker containerization ready

๐Ÿš€ Features

๐ŸŽฏ Core Functionality

  • Area of Interest (AOI) Selection: Interactive polygon drawing on Google Maps
  • Vacant Land Detection: Real-time ESA WorldCover processing via Google Earth Engine
  • Hotspot Scoring: ML-powered development suitability analysis
  • Service Gap Identification: Automated accessibility analysis
  • Environmental Monitoring: Multi-layer satellite data visualization

๐Ÿ“Š Advanced Analytics

  • Real-time Processing: Sub-30 second analysis for most AOIs
  • Multi-source Integration: Satellite + API + ML model fusion
  • Geospatial Caching: MongoDB-based result caching for performance
  • Comprehensive Reporting: Detailed breakdowns with recommendations

๐ŸŽจ User Interface

  • Interactive Mapping: Google Maps with custom overlays
  • Layer Control: Toggle between LST, NDVI, air quality layers
  • Live Search Results: Real-time API status visualization
  • Responsive Design: Mobile-friendly interface
  • Dark/Light Themes: Customizable UI themes

๐Ÿ“ Project Structure

Threshold/
โ”œโ”€โ”€ Backend/                 # FastAPI application
โ”‚   โ”œโ”€โ”€ api/routes/         # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py         # Authentication
โ”‚   โ”‚   โ”œโ”€โ”€ vacant_land.py  # Vacant land analysis
โ”‚   โ”‚   โ”œโ”€โ”€ service_analysis.py # Service gap analysis
โ”‚   โ”‚   โ””โ”€โ”€ aqi.py          # Air quality calculations
โ”‚   โ”œโ”€โ”€ services/           # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ gee_service.py  # Google Earth Engine
โ”‚   โ”‚   โ”œโ”€โ”€ esa_worldcover_service.py # Satellite processing
โ”‚   โ”‚   โ”œโ”€โ”€ hotspot_scoring_service.py # ML scoring
โ”‚   โ”‚   โ””โ”€โ”€ service_analysis_service.py # Service analysis
โ”‚   โ”œโ”€โ”€ models/             # Pydantic models
โ”‚   โ””โ”€โ”€ database/           # MongoDB connection
โ”œโ”€โ”€ Frontend/               # React application
โ”‚   โ”œโ”€โ”€ src/components/     # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx   # Main dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ Maps.tsx        # Satellite layer visualization
โ”‚   โ”‚   โ””โ”€โ”€ Hotspots.tsx    # Hotspot analysis interface
โ”‚   โ””โ”€โ”€ public/             # Static assets
โ”œโ”€โ”€ Model/                  # ML model training
โ”‚   โ”œโ”€โ”€ dataset_generator.py # Custom dataset creation
โ”‚   โ”œโ”€โ”€ train_hotspot_model.py # Model training pipeline
โ”‚   โ”œโ”€โ”€ hotspot_model.pkl   # Trained model
โ”‚   โ””โ”€โ”€ scaler.pkl          # Feature scaler
โ””โ”€โ”€ README.md               # This file

๐Ÿ”ง Installation & Setup

Prerequisites

  • Node.js 18+ (Frontend)
  • Python 3.9+ (Backend)
  • MongoDB 5.0+ (Database)
  • Google Earth Engine Account
  • Google Maps API Key

Backend Setup

cd Backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure environment variables
cp config.example.env .env
# Edit .env with your API keys and database credentials

# Run the server
python main.py

Frontend Setup

cd Frontend
npm install
npm run dev

Environment Variables

# Google Earth Engine
GEE_SERVICE_ACCOUNT_KEY_PATH=path/to/service-account.json
GEE_SERVICE_ACCOUNT_EMAIL=your-service-account@project.iam.gserviceaccount.com

# Google Maps API
GOOGLE_MAPS_API_KEY=your-google-maps-api-key

# Database
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=threshold

# Security
SECRET_KEY=your-secret-key

๐Ÿ“Š API Documentation

Core Endpoints

Vacant Land Analysis

POST /api/vacant-land/
Content-Type: application/json

{
  "aoi_geometry": {
    "type": "Polygon",
    "coordinates": [[[lng, lat], ...]]
  },
  "min_area_m2": 5000,
  "max_polygons": 100
}

Service Gap Analysis

POST /api/service-analysis/
Content-Type: application/json

{
  "aoi_bounds": {
    "north": 23.1, "south": 22.9,
    "east": 72.7, "west": 72.3
  },
  "service_types": ["parks", "food", "healthcare", "transport"],
  "grid_resolution": 2.0
}

AQI Calculation

GET /api/aqi/calculate?latitude=23.0225&longitude=72.5714&date=2024-01-15

๐ŸŽฏ Use Cases

Urban Planners

  • Identify optimal locations for new residential developments
  • Assess service accessibility gaps in existing neighborhoods
  • Monitor environmental conditions affecting development suitability
  • Generate data-driven recommendations for infrastructure investment

Government Agencies

  • Strategic urban development planning
  • Public service optimization
  • Environmental impact assessment
  • Resource allocation prioritization

Real Estate Developers

  • Site selection for residential projects
  • Market analysis based on accessibility metrics
  • Environmental risk assessment
  • Investment opportunity identification

Researchers & NGOs

  • Urban sustainability studies
  • Environmental justice analysis
  • Public health accessibility research
  • Climate change impact assessment

๐ŸŒŸ Innovation Highlights

๐Ÿ”ฌ Technical Innovations

  1. Custom ML Dataset: First-of-its-kind synthetic urban hotspot dataset with realistic correlations
  2. Multi-source Fusion: Integration of satellite data, real-time APIs, and ML predictions
  3. Real-time Processing: Sub-30 second analysis using Google Earth Engine
  4. Adaptive Fallbacks: Robust system with multiple data source fallbacks

๐ŸŽฏ Urban Planning Impact

  1. Evidence-based Decision Making: Quantitative metrics for development planning
  2. Service Equity Analysis: Identifies underserved areas requiring attention
  3. Environmental Integration: Considers air quality and climate factors
  4. Scalable Solution: Applicable to any global location

๐Ÿ”ฎ Future Enhancements

Short-term (3-6 months)

  • Population Prediction: Integrate population growth forecasting
  • Economic Indicators: Add economic accessibility metrics
  • Mobile Application: Native mobile app development
  • Batch Processing: Large-scale regional analysis capabilities

Long-term (6-12 months)

  • 3D Visualization: Three-dimensional urban modeling
  • Temporal Analysis: Historical trend analysis and future projections
  • AI-powered Recommendations: Advanced ML models for planning suggestions
  • Integration APIs: Third-party planning software integration

๐Ÿ™ Acknowledgments

  • NASA GIBS for providing free satellite data access
  • ESA WorldCover for high-resolution land cover datas
  • Google Earth Engine for cloud-based geospatial processing
  • Open-Meteo for air quality data API
  • NASA Space Apps Challenge for the inspiration and platform

Threshold - Where data meets urban planning

About

Threshold - Urban Development & Service Gap Analysis Platform Threshold is a comprehensive geospatial analysis platform that combines satellite remote sensing, machine learning, and real-time data processing to identify optimal locations for urban development and analyze service accessibility gaps.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages