floodDM

floodDM

new floodDM()

This class contains methods which can be used to model various flood damage and mitigation scenarios for hydrological analyses.

Source:

Methods

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

Calculates the property details and optionally retrieves flood damage and mitigation options.

Parameters:
Name Type Attributes Description
params Object

An object containing additional parameters (currently unused).

args Object

An object containing the property details and optional flood depth and mitigation depth.

params.occupancy string

The occupancy type (e.g., 'RES1', 'COM1', 'IND1', 'GOV1', 'AGR1').

params.structuralValue number

The structural value of the property.

params.contentValue number

The content value of the property.

params.buildingArea number

The building area of the property.

args.floodDepth number <optional>

The flood depth for which to calculate the damage (optional).

args.mitigationDepth number <optional>

The desired mitigation measure (optional).

args.mitigationDepth number <optional>

The desired mitigation depth (optional).

data Object

Additional data (currently unused).

Source:
Returns:

A Promise that resolves with an object containing the property details, and optionally the flood depth, calculated losses, and mitigation options.

Type
Promise.<Object>
Example
const propertyDetails = await floodDM.buildPropertyDMScenario({}, { occupancy: 'RES1', structuralValue: 200000, contentValue: 100000, buildingArea: 2000 }, {});
console.log(propertyDetails);

const propertyDamage = await floodDM.buildPropertyDMScenario({}, { occupancy: 'RES1', structuralValue: 200000, contentValue: 100000, buildingArea: 2000, floodDepth: 3 }, {});
console.log(propertyDamage);

const propertyDamageAndMitigation = await floodDM.buildPropertyDMScenario({}, { occupancy: 'RES1', structuralValue: 200000, contentValue: 100000, buildingArea: 2000, floodDepth: 3, mitigationDepth: 2 }, {});
console.log(propertyDamageAndMitigation);

(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(params, args, data) → {Promise.<(Object|null)>}

Retrieves bridge 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
bridge_type string

The type of the bridge, either "Single Span" or "Continuous Span".

scour_index string

The scour index, which can be "Unknown", "1", "2", or "3".

flood_scenario string

The flood scenario, from "25 yr" to "500 yr" in 25-year intervals.

replacement_value number

The replacement value of the bridge.

data Object

Additional data (currently unused).

Source:
Returns:

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

Type
Promise.<(Object|null)>

(async, static) getCityFloodDamage() → {Object}

Retrieves flood damage data for a given flood depth.

Parameters:
Name Type Description
args.city String

An array of objects containing flood damage data for each flood level.

args.depth number

The flood depth for which to retrieve damage data.

Source:
Returns:

An object containing the number of buildings affected, the structural loss, and the content loss for the closest matching flood level.

Type
Object
Example
hydro.analyze.hydro.getCityFloodDamage({
  args: { depth: 30.5, city: "Cedar Rapids" }
});

(static) getFloodInundation(data) → {Object}

Returns an array of GeoJSON point features of Buildings from midas data source and community_flood_inundation datatype based on flood depth

Parameters:
Name Type Description
data Array.<Object>

An array of objects containing flood damage data for each flood level.

args.depth number

The flood depth for which to retrieve inundation data.

Source:
Returns:

An object containing the number of buildings affected for the closest matching flood level.

Type
Object
Example
hydro.analyze.hydro.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": {
        ...
     },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -92.39561119522634,
          42.47028021204937
        ]
      }
    },...

(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(params, args) → {Promise.<Object>}

Initialize the damage scenario for a particular city, 100 or 500 year flood scenario and render based on google or leaflet

Parameters:
Name Type Description
params Object

Parameters to define map data to initialize

Properties
Name Type Description
maptype String

Type of map to initialize as a String, currently supported values are google or leaflet

key String

Required if maptype is google, pass in the API key for google maps

args Object

Arguments to initialize flood damage scenario being intialized

Properties
Name Type Description
city String

City name as a String, currently supported cities include Bettendorf, Cedar Falls, Cedar Rapids, Davenport, Iowa City, Waterloo and Waverly

depth number

Number value indicating flood depth

Source:
Returns:

A Promise that resolves with an object containing the scenario results, and damage values for the scenario

Type
Promise.<Object>
Example
scenario = new floodDM()
scenario.initDamageScenario({params:{maptype:'leaflet'},args:{city:"Cedar Falls", depth:18, scenario:'500-year'}})

(async) initMitigationScenario()

Initialize flood mitigation scenario

Parameters:
Name Type Description
args.city String

City name for which mitigation scenario needs to be built. Allowed cities are Waterloo, Cedar Rapids or Cedar Falls

args.depth number

The flood depth for which to retrieve damage data.

Source:
Example
hydro.analyze.hydro.initMitigationScenario({
  args: { city : "Waterloo", depth: 30.5 }
});

(async) runMitigationScenario()

Run the damage and mitigation scenario of the selected property based on flood depth and mitigation parameters

Parameters:
Name Type Description
args.city String

City name for which mitigation scenario needs to be built. Allowed cities are Waterloo, Cedar Rapids or Cedar Falls

args.depth number

The flood depth for which to retrieve damage data.

Source:
Example
hydro.analyze.hydro.initMitigationScenario({
  args: { city : "Waterloo", depth: 30.5 }
});