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.
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
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- 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
- Satellite: MODIS Terra
- Dataset:
MODIS_Terra_Land_Surface_Temp_Day - Resolution: 1 km (GoogleMapsCompatible_Level7)
- Temporal: Daily
- Usage: Heat island analysis, climate monitoring
- Satellite: MODIS Terra
- Dataset:
MODIS_Terra_NDVI_8Day - Resolution: 250m (GoogleMapsCompatible_Level9)
- Temporal: 8-day composite
- Usage: Vegetation health, urban green space analysis
- 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)
Our platform features a unique, synthetic dataset specifically designed for urban hotspot analysis:
- 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
- AQI (Air Quality Index): 0-500 scale
- Population Density: People per kmยฒ
- Distance to Hospital: km
- Distance to School: km
- Distance to Airport: km
- Distance to Bus Station: km
- Distance to Railway: km
- Distance to Mall: km
# 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)- 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
- 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
# 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- Oโ: ฮผg/mยณ โ ppb (ร0.5)
- NOโ: ฮผg/mยณ โ ppb (ร0.532)
- SOโ: ฮผg/mยณ โ ppb (ร0.382)
- ๐ณ Parks & Recreation: Parks, playgrounds, recreational facilities
- ๐ Food Access: Supermarkets, grocery stores, restaurants
- ๐ฅ Healthcare: Hospitals, clinics, pharmacies
- ๐ Public Transport: Bus stations, train stations, airports
- 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)
- Primary: Google Places API (20+ place types per service)
- Fallback: OpenStreetMap Overpass API
- Distance: Google Distance Matrix API + Haversine fallback
# 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// 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: MongoDB (geospatial indexing)
- Authentication: JWT with bcrypt hashing
- APIs: RESTful with OpenAPI documentation
- Deployment: Docker containerization ready
- 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
- 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
- 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
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
- Node.js 18+ (Frontend)
- Python 3.9+ (Backend)
- MongoDB 5.0+ (Database)
- Google Earth Engine Account
- Google Maps API Key
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.pycd Frontend
npm install
npm run dev# 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-keyPOST /api/vacant-land/
Content-Type: application/json
{
"aoi_geometry": {
"type": "Polygon",
"coordinates": [[[lng, lat], ...]]
},
"min_area_m2": 5000,
"max_polygons": 100
}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
}GET /api/aqi/calculate?latitude=23.0225&longitude=72.5714&date=2024-01-15- 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
- Strategic urban development planning
- Public service optimization
- Environmental impact assessment
- Resource allocation prioritization
- Site selection for residential projects
- Market analysis based on accessibility metrics
- Environmental risk assessment
- Investment opportunity identification
- Urban sustainability studies
- Environmental justice analysis
- Public health accessibility research
- Climate change impact assessment
- Custom ML Dataset: First-of-its-kind synthetic urban hotspot dataset with realistic correlations
- Multi-source Fusion: Integration of satellite data, real-time APIs, and ML predictions
- Real-time Processing: Sub-30 second analysis using Google Earth Engine
- Adaptive Fallbacks: Robust system with multiple data source fallbacks
- Evidence-based Decision Making: Quantitative metrics for development planning
- Service Equity Analysis: Identifies underserved areas requiring attention
- Environmental Integration: Considers air quality and climate factors
- Scalable Solution: Applicable to any global location
- 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
- 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
- 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



.png)
.png)
.png)
.png)
.png)
.png)

.png)