new floodDM()
This class contains methods which can be used to model various flood damage and mitigation scenarios for hydrological analyses.
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). |
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
|
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
|
|||||||||||||||
data |
Object | Additional data (currently unused). |
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. |
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. |
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
|
|||||||||||||||
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(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
|
|||||||||
args |
Object | Arguments to initialize flood damage scenario being intialized Properties
|
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. |
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. |
Example
hydro.analyze.hydro.initMitigationScenario({
args: { city : "Waterloo", depth: 30.5 }
});