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.
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
|
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
|
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
|
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
|
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
|
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
|
|||||||||||||||
data |
Object | Additional data (currently unused). |
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
|
|||||||||||||||||||||
data |
Object | Additional data (currently unused). |
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
|
||||||||||||
data |
Object | Additional data (currently unused). |
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
|
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
|
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
|
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
|
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