PublicRisk.ai

Geospatial Risk & HAZUS Integration

Advanced natural hazard assessment with FEMA HAZUS, real-time wildfire tracking, and multi-hazard risk modeling

Overview

PublicRisk.ai integrates FEMA HAZUS data and methodologies to provide comprehensive geospatial risk assessment across natural hazards including flood, earthquake, hurricane, tsunami, and wildfire.

Production Ready: All HAZUS features (Phases 1-5) are deployed and operational as of December 2025


HAZUS Integration Features

Phase 1: Hazard Zone Visualization ✅

Interactive Leaflet maps with real-time hazard data.

Features:

  • OpenStreetMap base tiles with satellite imagery option
  • Color-coded zones by hazard type
  • Toggle buttons to show/hide specific hazards
  • Clickable popups with detailed zone information
  • Export to PDF/PNG

Map Controls:

// Toggle Hazards
- [✓] Flood Zones (Red)
- [✓] Earthquake PGA (Orange) 
- [✓] Hurricane Winds (Purple)
- [ ] Tsunami Zones (Blue)
- [✓] Wildfire VHFHSZ (Yellow)

// Map Styles
- Streets (OpenStreetMap)
- Satellite (Esri)
- Grayscale (Carto)
- Terrain (OpenTopoMap)

Phase 2: Real HAZUS Geometries ✅

Integration with authoritative federal data sources.

Data Sources:

HazardSourceUpdate FrequencyGeometry Type
FloodFEMA NFHLQuarterlyPolygons (Zone AE, VE, X)
EarthquakeUSGS NSHMAnnualContours (PGA values)
HurricaneNOAA H*WindReal-timeWind field models
TsunamiNOAA NGDCAs-neededInundation zones
WildfireNIFCDailyPerimeters + Active fires

Coordinate Systems:

  • Input: WGS84 (EPSG:4326)
  • Processing: Web Mercator (EPSG:3857)
  • Output: WGS84 for compatibility

Phase 3: Building Exposure Analysis ✅

Spatial intersection analysis with building inventory.

Capabilities:

# Example: Buildings in flood zone
Result:
  - Total Buildings: 247
  - Residential: 189 (76.5%)
  - Commercial: 42 (17.0%)
  - Industrial: 16 (6.5%)
  - Total Value at Risk: $87.3M

Analysis Types:

  1. Point-in-Polygon: Single property risk check
  2. Buffer Analysis: Risk within radius (e.g., 1km from fault line)
  3. Polygon Overlay: All properties in hazard zone
  4. Multi-Hazard: Properties exposed to 2+ hazards

Phase 4: Loss Estimation ✅

HAZUS damage functions for financial impact assessment.

Damage Severity Levels:

Zone TypeLoss RatioDescription
Critical25%Severe structural damage expected
High15%Major damage, repairs required
Moderate8%Minor damage, habitable
Low3%Cosmetic damage only

Example Loss Calculation:

Property Value: $850,000
Flood Zone: AE (High Risk)
Loss Ratio: 15%
Expected Loss: $127,500

+ Earthquake PGA: 0.35g (Moderate)
  Additional Loss: $68,000
  
Total Expected Annual Loss: $195,500 (23% of value)

SIPmath Integration: PublicRisk.ai uses probabilistic distributions for uncertainty quantification:

// Normal distribution example
const floodLoss = {
  mean: 127500,
  stdDev: 25500,
  trials: 10000
};

// 90% confidence interval
P10: $89,000
P50: $127,500  // Median
P90: $166,000

Phase 5: Multi-Hazard Combined Risk ✅

Spatial overlay of multiple hazards with weighted scoring.

Risk Weights:

const hazardWeights = {
  flood: 0.40,      // Highest frequency
  earthquake: 0.35, // High impact
  hurricane: 0.25,  // Regional
  tsunami: 0.30,    // Coastal only
  wildfire: 0.20    // Seasonal
};

Combined Risk Formula:

Total Risk Score = Σ (Hazard_i × Weight_i)

Example:
  Flood (High=3) × 0.40 = 1.20
  Earthquake (Moderate=2) × 0.35 = 0.70
  Wildfire (Low=1) × 0.20 = 0.20
  ─────────────────────────────────
  Total Risk Score = 2.10 (HIGH)

SLURP Correlation: For portfolio analysis, PublicRisk.ai preserves correlation between hazards using Gaussian copulas:

// Correlated hazards (not independent!)
correlation_matrix = [
  [1.00, 0.15, 0.25],  // Flood-Earthquake-Hurricane
  [0.15, 1.00, 0.10],
  [0.25, 0.10, 1.00]
];

// Cholesky decomposition for sampling
// Preserves trial-by-trial relationships

Historical Scenario Replay

Available Scenarios ✅

Analyze "What if this happened today?" for 7 major disasters:

Major Earthquake Scenarios

  1. 1906 San Francisco Earthquake

    • Magnitude: 7.9
    • Deaths (1906): 3,000+
    • Projected (2025): 5,800 deaths, $250B damage
  2. 1989 Loma Prieta Earthquake

    • Magnitude: 6.9
    • Deaths (1989): 63
    • Projected (2025): 120 deaths, $18B damage
  3. 1994 Northridge Earthquake

    • Magnitude: 6.7
    • Deaths (1994): 57
    • Projected (2025): 95 deaths, $35B damage

Major Hurricane Scenarios

  1. 1900 Galveston Hurricane

    • Category: 4
    • Deaths (1900): 8,000+
    • Projected (2025): 1,200 deaths, $45B damage
  2. 1992 Hurricane Andrew

    • Category: 5
    • Deaths (1992): 65
    • Projected (2025): 85 deaths, $95B damage
  3. 2005 Hurricane Katrina

    • Category: 5
    • Deaths (2005): 1,833
    • Projected (2025): 950 deaths, $180B damage
  4. 2017 Hurricane Harvey

    • Category: 4
    • Deaths (2017): 107
    • Projected (2025): 130 deaths, $150B damage

How Projections Work

Methodology:

  1. Extract original event parameters (magnitude, wind speed, track)
  2. Apply to current building inventory (2025 data)
  3. Adjust for modern building codes (20-30% loss reduction)
  4. Factor in population changes
  5. Calculate with HAZUS damage functions

Example: 1906 San Francisco Today

Original Event:
  - Magnitude: 7.9
  - Population (1906): 400,000
  - Building Stock: Mostly wood frame
  - Damage: $400M (1906 dollars)

2025 Projection:
  - Same epicenter and magnitude
  - Population: 875,000 (2.2× higher)
  - Building Stock: Mix of modern + unreinforced masonry
  - Seismic Codes: 30% loss reduction
  - Damage: $250B (inflation + growth - code improvements)

Real-Time Wildfire Analysis

Active Fire Tracking ✅

Integration with NIFC (National Interagency Fire Center) for live wildfire data.

Update Frequency: Every 60 seconds (configurable)

Data Points:

interface WildfireData {
  name: string;              // Fire name (e.g., "Caldor Fire")
  location: [lat, lng];      // Current perimeter center
  acres: number;             // Burned area
  containment: number;       // Percentage (0-100)
  startDate: Date;           // Ignition date
  fuels: string;             // Vegetation type
  personnel: number;         // Firefighters deployed
  structures: number;        // Buildings threatened
  cause: string;             // Lightning, Human, etc.
}

Evacuation Decision Support

Proximity Thresholds:

DistanceActionRisk Level
< 2 milesEVACUATE NOWCRITICAL
2-5 milesPrepare to evacuateHIGH
5-10 milesMonitor closelyMODERATE
> 10 milesStay informedLOW

Decision Tree:

Evacuation Routes

Features:

  • Real-time traffic integration
  • Bottleneck identification
  • Alternative route suggestions
  • Shelter location mapping
  • Hospital capacity tracking

Example Output:

EVACUATION RECOMMENDED
━━━━━━━━━━━━━━━━━━━━━

Fire: Caldor Fire
Distance: 3.2 miles SW
Wind: 15 mph NE (TOWARD YOU)
Containment: 15%

RECOMMENDED ROUTES:
1. Highway 50 East → Placerville (18 min, LOW TRAFFIC)
2. Ice House Road → Highway 50 (35 min, MODERATE)
3. AVOID: Silver Fork Road (CLOSED - Fire)

NEAREST SHELTERS:
- Placerville Fairgrounds (23 miles, 550 capacity)
- Cameron Park Community Center (31 miles, 300 capacity)

Interactive Map Features

Property Risk Dashboard

Access: Risk Calculator → Environmental Hazards → Property Risk Dashboard

Capabilities:

  1. Enter address or coordinates
  2. View all hazards on interactive map
  3. Click hazard zones for details
  4. See building exposure counts
  5. Review loss estimates
  6. Export PDF report

Example Usage:

// Input
Address: 123 Main St, Los Angeles, CA
Property Value: $850,000
Year Built: 1995

// Output
Overall Risk Score: 7.2/10 (HIGH)

Hazards Detected:
✓ Flood Zone AE (1% annual chance)
✓ Earthquake PGA 0.35g (Moderate-High shaking)
✓ Wildfire VHFHSZ (Very High Fire Hazard Severity)

Expected Annual Loss: $127,500 (15% of value)

Mitigation Recommendations:
1. Flood: Elevate utilities (+$15K, saves $8K/year)
2. Earthquake: Seismic retrofit (+$25K, saves $12K/year)
3. Wildfire: Defensible space (+$5K, saves $6K/year)

Hazard Mapper

Access: Sidebar → Hazard Mapper

Features:

  • Multi-point analysis (add unlimited markers)
  • Point management sidebar with labels
  • Inline editing of point names
  • One-click deletion
  • Batch API calls with error handling
  • Map style selector (Streets/Satellite/Grayscale/Terrain)

Recent Improvements (Dec 2025):

  • ✅ Point management panel (bottom-right)
  • ✅ Editable point labels
  • ✅ Individual error handling (no cascade failures)
  • ✅ High-contrast flood zone colors (red/yellow/orange)
  • ✅ Increased stroke weight (4px) and opacity (0.9)

Data Attribution

PublicRisk.ai integrates authoritative federal data:

Government Agencies:

  • FEMA - National Flood Hazard Layer (NFHL)
  • USGS - National Seismic Hazard Maps, earthquake PGA
  • NOAA - Hurricane wind fields (H*Wind), tsunami models
  • NIFC - Active wildfire perimeters and data
  • EPA - Environmental hazards (RMP, TRI facilities)

Update Schedule:

  • Flood: Quarterly (FEMA)
  • Earthquake: Annual (USGS)
  • Hurricane: Real-time during events (NOAA)
  • Wildfire: Daily (NIFC, 60s polling in app)
  • Tsunami: As-needed (NOAA NGDC)

API Endpoints

HAZUS Hazard Service

https://publicrisk--publicrisk-hazard-service-*.modal.run

Endpoints:

  1. Health Check

    GET /health
    
    Response: {
      "status": "healthy",
      "version": "1.2.0",
      "uptime": 3600
    }
  2. Flood Risk

    GET /flood?lat=34.0522&lng=-118.2437
    
    Response: {
      "zone": "AE",
      "risk_level": "High",
      "annual_chance": 0.01,
      "base_flood_elevation": 125.5
    }
  3. Earthquake Risk

    GET /earthquake?lat=37.7749&lng=-122.4194
    
    Response: {
      "pga": 0.42,
      "risk_level": "Very High",
      "fault_distance": 8.3,
      "nearest_fault": "San Andreas"
    }
  4. Wildfire Risk

    GET /wildfire?lat=38.7519&lng=-120.7983
    
    Response: {
      "fhsz": "Very High",
      "nearest_fire": "Caldor Fire",
      "distance_km": 4.8,
      "containment": 15,
      "recommendation": "EVACUATE NOW"
    }
  5. Combined Hazards

    GET /realtime-all?lat=34.0522&lng=-118.2437
    
    Response: {
      "flood": {...},
      "earthquake": {...},
      "wildfire": {...},
      "combined_risk_score": 7.2
    }
  6. Property Assessment

    GET /assess-property?lat=34.0522&lng=-118.2437&property_value=850000&year_built=1995
    
    Response: {
      "overall_risk": 7.2,
      "hazards": [...],
      "expected_loss": 127500,
      "mitigation": [...]
    }

Best Practices

Performance Optimization

Cold Start Handling:

// Modal services sleep after 5-10 min inactivity
// First request: 30-60s (cold start)
// Subsequent: less than 3s (warm)

// Show user-friendly message
if (loading && elapsed > 10000) {
  showMessage("Service starting (first-time may take 30-60s)...");
}

Debouncing Map Interactions:

// Prevent excessive API calls when panning map
const debouncedFetch = debounce(fetchHazardData, 500);

map.on('moveend', () => {
  debouncedFetch(map.getCenter());
});

Error Handling

Graceful Degradation:

try {
  const floodData = await getFloodRisk(lat, lng);
} catch (error) {
  console.warn("Flood API unavailable, using cached data");
  return cachedFloodData;
}

// Continue with other hazards even if one fails

Troubleshooting

Common Issues

Issue: "Service timeout after 30s"

  • Cause: Modal cold start
  • Solution: Wait and retry. Service warms up after first request.

Issue: "No hazard data found"

  • Cause: Location outside US or no hazards present
  • Solution: Verify coordinates are in US territory.

Issue: "Flood zones not visible on map"

  • Cause: Blue zones on blue background
  • Solution: Use Grayscale or Terrain map style (fixed in Dec 2025 update with red/yellow/orange zones).

Issue: "404 error when adding multiple points"

  • Cause: Legacy issue with cascading API failures
  • Solution: Fixed in Dec 2025 update with individual error handling.

Next Steps

On this page