floodDM

floodDM

new floodDM()

This class contains methods for modeling various flood damage and mitigation scenarios for hydrological analyses. Provides comprehensive flood impact assessment including property damage, vehicle damage, infrastructure damage, life loss estimation, and mitigation planning capabilities for multiple cities.

Source:
Example
// Initialize a new flood damage and mitigation scenario
const scenario = new floodDM();

// Run a damage scenario for Cedar Falls with 18ft depth, 500-year flood
const damageResults = await scenario.initDamageScenario({
  params: { maptype: 'leaflet' },
  args: { city: "Cedar Falls", depth: 18, scenario: '500-year' }
});

// Run a mitigation scenario for Waterloo
const mitigationResults = await scenario.initMitigationScenario({
  params: { maptype: 'leaflet' },
  args: { city: "Waterloo", depth: 30.5 }
});

Methods

(async, static) buildPropertyDMScenario(options) → {Promise.<Object>}

Builds a comprehensive property damage and mitigation scenario for a specific building. Calculates flood damage estimates, business interruption losses, and evaluates mitigation options with detailed cost-benefit analysis.

Parameters:
Name Type Description
options Object

Configuration object for property analysis

Properties
Name Type Attributes Description
params Object

Property characteristics and values

Properties
Name Type Description
occupancy string

Building occupancy type (e.g., 'RES1-1SNB', 'COM1', 'IND1', 'GOV1', 'AGR1')

structuralValue number

Replacement value of building structure in dollars

contentValue number

Value of building contents in dollars

buildingArea number

Building floor area in square feet

args Object

Flood scenario and mitigation parameters

Properties
Name Type Attributes Description
floodDepth number <optional>

Flood depth above building in feet

mitigationMeasure string <optional>

Type of mitigation ('Elevation', 'Dry Floodproofing', 'Wet Floodproofing', etc.)

mitigationDepth number <optional>

Protection depth provided by mitigation in feet

foundationType string <optional>

Foundation type ('footing' or 'slab on grade')

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to comprehensive property analysis results

Type
Promise.<Object>
Examples
// Basic property damage calculation
const damageAnalysis = await floodDM.buildPropertyDMScenario({
  params: {
    occupancy: 'RES1-1SNB',
    structuralValue: 250000,
    contentValue: 125000,
    buildingArea: 2000
  },
  args: {
    floodDepth: 4.0
  }
});

console.log(damageAnalysis.structuralLoss);  // "$45,000"
console.log(damageAnalysis.contentLoss);     // "$62,500"
// Property damage with mitigation analysis
const mitigationAnalysis = await floodDM.buildPropertyDMScenario({
  params: {
    occupancy: 'COM1',
    structuralValue: 500000,
    contentValue: 300000,
    buildingArea: 5000
  },
  args: {
    floodDepth: 6.0,
    mitigationMeasure: 'Elevation',
    mitigationDepth: 8.0,
    foundationType: 'footing'
  }
});

console.log(mitigationAnalysis.mitigationOptions.cost);     // "$75,000"
console.log(mitigationAnalysis.mitigationOptions.benefit);  // "$45,000"
// Compare different mitigation strategies
const dryFloodproofing = await floodDM.buildPropertyDMScenario({
  params: {
    occupancy: 'RES1-1SNB',
    structuralValue: 200000,
    contentValue: 100000,
    buildingArea: 1800
  },
  args: {
    floodDepth: 3.0,
    mitigationMeasure: 'Dry Floodproofing',
    mitigationDepth: 5.0,
    foundationType: 'slab on grade'
  }
});

// Result includes formatted dollar values and cost-benefit ratios

(private, static) createTableFromObject(args) → {HTMLTableElement}

Helper function to create an HTML table element from a JavaScript object.

Parameters:
Name Type Description
args Object

An object containing the arguments for the function.

Properties
Name Type Default Description
obj Object

The JavaScript object to convert to an HTML table.

depth number 0

The depth level of the current object (used for indentation).

showHeader boolean true

Whether to display the object keys as table headers (bold text).

tableHeaderText string | null null

The text to display in the table header row (if provided).

Source:
Returns:

The HTML table element created from the object.

Type
HTMLTableElement

(async, static) getBridgeDamage(options) → {Promise.<(Object|null)>}

Calculates bridge damage estimates based on bridge characteristics and flood scenario. Evaluates structural damage and functional capacity loss for different bridge types under various flood return periods considering scour potential.

Parameters:
Name Type Description
options Object

Configuration object for bridge damage assessment

Properties
Name Type Attributes Description
params Object <optional>

Additional parameters (currently unused)

args Object

Arguments for bridge damage calculation

Properties
Name Type Description
bridge_type string

Bridge structural type: "Single Span" or "Continuous Span"

scour_index string

Scour vulnerability index: "Unknown", "1", "2", or "3" (1=low, 3=high risk)

flood_scenario string

Flood return period: "25 yr", "50 yr", "100 yr", "200 yr", "500 yr"

replacement_value number

Total replacement cost of the bridge in dollars

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to bridge damage assessment or null if no match found

Type
Promise.<(Object|null)>
Examples
// Assess damage to a single span bridge in 100-year flood
const bridgeDamage = await floodDM.getBridgeDamage({
  args: {
    bridge_type: "Single Span",
    scour_index: "2",
    flood_scenario: "100 yr",
    replacement_value: 2500000
  }
});

console.log(bridgeDamage.damagePercent);  // 0.15 (15% damage)
console.log(bridgeDamage.damageCost);     // 375000 (in dollars)
// Assess damage to continuous span bridge with high scour risk
const majorBridgeDamage = await floodDM.getBridgeDamage({
  args: {
    bridge_type: "Continuous Span",
    scour_index: "3",
    flood_scenario: "500 yr",
    replacement_value: 8500000
  }
});
// Handle unknown scour conditions
const uncertainDamage = await floodDM.getBridgeDamage({
  args: {
    bridge_type: "Single Span",
    scour_index: "Unknown",
    flood_scenario: "200 yr",
    replacement_value: 1200000
  }
});

(async, static) getCityFloodDamage(options) → {Promise.<(Object|string)>}

Retrieves comprehensive flood damage data for a specific city and flood depth. Accesses pre-computed damage estimates from the MIDAS database including building counts, economic losses, and emission scenarios.

Parameters:
Name Type Description
options Object

Configuration object for damage data retrieval

Properties
Name Type Attributes Description
params Object <optional>

Additional parameters (currently unused)

args Object

Arguments for damage data query

Properties
Name Type Description
city string

City name for damage lookup. Supported: 'Cedar Rapids', 'Cedar Falls', 'Waterloo'

depth number

Flood depth in feet for which to retrieve damage data

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to damage data object or error message

Type
Promise.<(Object|string)>
Examples
// Get flood damage data for Cedar Rapids at 30.5ft depth
const damageData = await floodDM.getCityFloodDamage({
  args: { 
    city: "Cedar Rapids", 
    depth: 30.5 
  }
});

console.log(damageData.flood_level);      // "30.5"
console.log(damageData.buildings);       // Number of buildings affected
console.log(damageData.struct_loss);     // Structural loss estimate
console.log(damageData.cont_loss);       // Content loss estimate
// Get damage data for Waterloo at different depth
const waterlooData = await floodDM.getCityFloodDamage({
  args: { 
    city: "Waterloo", 
    depth: 25.0 
  }
});
// Handle invalid inputs
const invalidData = await floodDM.getCityFloodDamage({
  args: { 
    city: "InvalidCity", 
    depth: 30.5 
  }
});
// Returns: "City or depth not found"

(static) getFloodInundation(options) → {Object}

Filters a GeoJSON FeatureCollection to return only buildings that would be flooded at a specific depth. Takes building features with depth-specific properties and returns only those with significant inundation.

Parameters:
Name Type Description
options Object

Configuration object for flood inundation filtering

Properties
Name Type Attributes Description
params Object <optional>

Additional parameters (currently unused)

args Object

Arguments for filtering

Properties
Name Type Description
depth number

Flood depth in feet for filtering buildings

data Object

GeoJSON FeatureCollection with building data

Properties
Name Type Description
type string

Must be "FeatureCollection"

features Array

Array of GeoJSON Feature objects with flood depth properties

Source:
Returns:

Filtered GeoJSON FeatureCollection containing only buildings with flood depth >= 1 foot

Type
Object
Examples
// Filter buildings for 20ft flood depth
const floodedBuildings = floodDM.getFloodInundation({
  args: { depth: 20 }, 
  data: {
    "type": "FeatureCollection",
    "name": "waterloo",
    "crs": {
      "type": "name",
      "properties": {
        "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
      }
    },
    "features": [
      {
        "type": "Feature",
        "properties": {
          "depth200": 3.5,  // Depth at 20.0ft scenario
          "gid": 1,
          "occupancy": "RES1-1SNB"
        },
        "geometry": {
          "type": "Point",
          "coordinates": [-92.39561, 42.47028]
        }
      }
    ]
  }
});

// Returns only buildings where depth200 >= 1.0
console.log(floodedBuildings.features.length); // Number of significantly flooded buildings
// Handle edge cases
const invalidData = floodDM.getFloodInundation({
  args: { depth: "invalid" },
  data: { type: "FeatureCollection", features: [] }
});
// Returns: { error: "Invalid args format" }
// Process different flood depths
const depth15Buildings = floodDM.getFloodInundation({
  args: { depth: 15.5 },
  data: buildingFeatures
});
// Uses "depth155" property (15.5 * 10 = 155)

(static) getLifeLoss(params, args, data) → {Promise.<(Object|null)>}

Retrieves loss of life data based on the provided arguments.

Parameters:
Name Type Description
params Object

An object containing additional parameters (currently unused).

args Object

An object containing the required arguments.

Properties
Name Type Description
occupancy string

The occupancy type (e.g., 'RES1-1SNB', 'COM1', 'IND1', etc.).

depth number

The flood depth in feet.

peopleOver65 number

The number of people living in this dwelling over 65.

peopleUnder65 number

he number of people living in this dwelling under 65.

data Object

Additional data (currently unused).

Source:
Returns:

A Promise that resolves with an object containing the utility damage data, or null if no matching data is found or an error occurs.

Type
Promise.<(Object|null)>

(async, static) getPropertyLoss(params, args, data) → {Promise.<Object>}

Retrieves property loss data, including structure and content damage, business interruption losses, and debris amount based on the provided arguments.

Parameters:
Name Type Description
params Object

An object containing additional parameters (currently unused).

args Object

An object containing the required arguments.

Properties
Name Type Description
occupancy string

The occupancy type (e.g., 'RES1-1SNB', 'COM1', 'IND1', etc.).

depth number

The flood depth in feet.

foundationType string

The foundation type ('footing' or 'slab on grade').

structureValue number

The structure value of the property.

contentValue number

The content value of the property.

area number

The area of the property in square feet.

data Object

Additional data (currently unused).

Source:
Returns:

A Promise that resolves with an object containing the property loss, business interruption, and debris amount data.

Type
Promise.<Object>

(async, static) getUtilityDamage(params, args, data) → {Promise.<(Object|null)>}

Retrieves utility damage data based on the provided arguments.

Parameters:
Name Type Description
params Object

An object containing additional parameters (currently unused).

args Object

An object containing the required arguments.

Properties
Name Type Description
utility string

The utility system (e.g., "PDFLT", "PPPL", "WWTL", etc.).

depth number

The flood depth in feet.

utilityValue number

The replacement value of the utility.

data Object

Additional data (currently unused).

Source:
Returns:

A Promise that resolves with an object containing the utility damage data, or null if no matching data is found or an error occurs.

Type
Promise.<(Object|null)>

(async, static) getVehicleDamage(options) → {Promise.<(object|null)>}

Fetches vehicle damage information based on flood depth and vehicle type.

Parameters:
Name Type Description
options object

Options object containing parameters, arguments, and data.

Properties
Name Type Description
params object

Parameters object (not used in this method).

args object

Arguments object containing floodDepth, vehicleType, vehicleCount, and vehicleValue.

data object

Additional data (not used in this method).

Source:
Returns:

A Promise resolving to an object containing damage and damage percentage, or null if an error occurs.

Type
Promise.<(object|null)>

(async) initDamageScenario(options) → {Promise.<Object>}

Initialize a comprehensive damage scenario for a particular city with specified flood parameters. Calculates and visualizes damage to buildings, vehicles, bridges, and utilities while estimating life loss and debris generation. Renders an interactive map with damage layers and summary statistics.

Parameters:
Name Type Description
options Object

Configuration object for damage scenario

Properties
Name Type Attributes Description
params Object <optional>

Parameters for map rendering and visualization

Properties
Name Type Attributes Default Description
maptype string <optional>
'leaflet'

Type of map to render: 'google' or 'leaflet'

key string <optional>

Google Maps API key (required if maptype is 'google')

args Object

Arguments defining the flood scenario

Properties
Name Type Description
city string

City name. Supported: 'Bettendorf', 'Cedar Falls', 'Cedar Rapids', 'Davenport', 'Iowa City', 'Waterloo', 'Waverly'

depth number

Flood depth in feet

scenario string

Flood return period: '100-year' or '500-year'

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to comprehensive damage assessment results

Type
Promise.<Object>
Examples
// Initialize damage scenario for Cedar Falls with 500-year flood at 18ft depth
const scenario = new floodDM();
const damageResults = await scenario.initDamageScenario({
  params: { 
    maptype: 'leaflet'  // or 'google' with API key
  },
  args: { 
    city: "Cedar Falls", 
    depth: 18, 
    scenario: '500-year' 
  }
});

// Results include damage categories:
console.log(damageResults.Buildings.Structure);     // "$2,450,000"
console.log(damageResults.Vehicles.Day);           // "$1,200,000"
console.log(damageResults.Bridges.Damage);         // "$850,000"
console.log(damageResults.Utilities.Damage);       // "$340,000"
// Initialize with Google Maps
const damageResults = await scenario.initDamageScenario({
  params: { 
    maptype: 'google',
    key: 'your-google-maps-api-key'
  },
  args: { 
    city: "Waterloo", 
    depth: 25, 
    scenario: '100-year' 
  }
});
// View specific damage components
const results = await scenario.initDamageScenario({
  params: { maptype: 'leaflet' },
  args: { city: "Davenport", depth: 22, scenario: '500-year' }
});

// Building damage breakdown
console.log(results.Buildings.Structure);           // Structural damage
console.log(results.Buildings.Content);             // Content damage  
console.log(results.Buildings.Income);              // Income loss
console.log(results.Buildings.Wage);                // Wage loss
console.log(results.Buildings["Loss of Life (Day)"]); // Fatalities during day
console.log(results.Buildings.Debris);              // Debris amount (tons)

(async) initMitigationScenario(options) → {Promise.<Object>}

Initialize a flood mitigation scenario for property-level analysis and intervention planning. Creates an interactive map displaying buildings at risk and provides tools for selecting individual properties to analyze mitigation options and cost-benefit calculations.

Parameters:
Name Type Description
options Object

Configuration object for mitigation scenario

Properties
Name Type Attributes Description
params Object <optional>

Parameters for map rendering and visualization

Properties
Name Type Attributes Default Description
maptype string <optional>
'leaflet'

Type of map to render: 'google' or 'leaflet'

key string <optional>

Google Maps API key (required if maptype is 'google')

args Object

Arguments defining the mitigation scenario

Properties
Name Type Description
city string

City name. Supported: 'Waterloo', 'Cedar Rapids', 'Cedar Falls'

depth number

Flood depth in feet for analysis

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to city-wide damage estimates and mitigation summary

Type
Promise.<Object>
Examples
// Initialize mitigation scenario for Waterloo at 30.5ft depth
const scenario = new floodDM();
const mitigationData = await scenario.initMitigationScenario({
  params: { maptype: 'leaflet' },
  args: { 
    city: "Waterloo", 
    depth: 30.5 
  }
});

// Results include city-wide damage estimates
console.log(mitigationData.low_emission);   // "$ 269.2 M"
console.log(mitigationData.high_emission);  // "$ 785.6 M"
// Initialize for Cedar Rapids with detailed building analysis
const results = await scenario.initMitigationScenario({
  params: { maptype: 'leaflet' },
  args: { 
    city: "Cedar Rapids", 
    depth: 25.0 
  }
});

// Click on building markers to select for detailed mitigation analysis
// Use runMitigationScenario() after selection for specific building analysis
// Initialize with Google Maps for Cedar Falls
const cedarFallsData = await scenario.initMitigationScenario({
  params: { 
    maptype: 'google',
    key: 'your-google-maps-api-key'
  },
  args: { 
    city: "Cedar Falls", 
    depth: 20.0 
  }
});

(async) runMitigationScenario(options) → {Promise.<HTMLTableElement>}

Run a detailed damage and mitigation analysis for a selected property. Must be called after initMitigationScenario() and after clicking on a building marker to select it. Calculates property-specific damage estimates and evaluates mitigation measures with cost-benefit analysis.

Parameters:
Name Type Description
options Object

Configuration object for property mitigation analysis

Properties
Name Type Attributes Description
params Object <optional>

Parameters (automatically set from selected building properties)

args Object

Arguments defining the mitigation analysis

Properties
Name Type Description
mitigationMeasure string

Type of mitigation measure to evaluate (e.g., 'Elevation', 'Dry Floodproofing', 'Wet Floodproofing')

mitigationDepth number

Depth of protection provided by mitigation measure (in feet)

foundationType string

Foundation type of the building ('footing' or 'slab on grade')

data Object <optional>

Additional data (currently unused)

Source:
Returns:

Promise resolving to HTML table element with detailed damage and mitigation summary

Type
Promise.<HTMLTableElement>
Examples
// First initialize mitigation scenario and select a building by clicking on map
const scenario = new floodDM();
await scenario.initMitigationScenario({
  params: { maptype: 'leaflet' },
  args: { city: "Waterloo", depth: 30.5 }
});

// Click on a building marker on the map to select it, then run analysis
const mitigationResults = await scenario.runMitigationScenario({
  args: {
    mitigationMeasure: 'Elevation',
    mitigationDepth: 5.0,
    foundationType: 'footing'
  }
});
// Analyze dry floodproofing for selected building
const dryFloodproofing = await scenario.runMitigationScenario({
  args: {
    mitigationMeasure: 'Dry Floodproofing',
    mitigationDepth: 3.0,
    foundationType: 'slab on grade'
  }
});
// Analyze wet floodproofing option
const wetFloodproofing = await scenario.runMitigationScenario({
  args: {
    mitigationMeasure: 'Wet Floodproofing',
    mitigationDepth: 2.0,
    foundationType: 'footing'
  }
});

// Results displayed as overlay table showing:
// - Current flood damage estimates
// - Mitigation costs
// - Net benefit/cost of mitigation
// - Building characteristics