diff --git a/.gitignore b/.gitignore
index 4cae3f03..7719602e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -132,4 +132,6 @@ examples/data/aggregation_zones/output
/examples/aggregation_zones_example_files
/examples/data/aggregation_zones/aggregation_zones_test1/
/examples/data/aggregation_zones/aggregation_zones_test2/
-examples/aggregation_zones_example.html
\ No newline at end of file
+examples/aggregation_zones_example.html
+examples/aggregation_zones_example_files/
+examples/data/road_network/FIAT model
\ No newline at end of file
diff --git a/docs/_static/Region_download.PNG b/docs/_static/Region_download.PNG
new file mode 100644
index 00000000..b3b17536
Binary files /dev/null and b/docs/_static/Region_download.PNG differ
diff --git a/docs/_static/charelston.PNG.svg b/docs/_static/charelston.PNG.svg
new file mode 100644
index 00000000..6d2a318e
--- /dev/null
+++ b/docs/_static/charelston.PNG.svg
@@ -0,0 +1,39 @@
+
+
+
+
diff --git a/examples/add_roadnetwork.ipynb b/examples/add_roadnetwork.ipynb
new file mode 100644
index 00000000..0224320d
--- /dev/null
+++ b/examples/add_roadnetwork.ipynb
@@ -0,0 +1,1319 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **FIAT Model Setup for a Road Network**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Roads are vital to the infrastructure of a community and, when blocked and/or (partially) destroyed \n",
+ "cause numerous issues for various players. Therefore, it is imperative to assess the impact of loss in mobility when analyzing flood events and other hazards. \n",
+ "\n",
+ "FIAT offers a tool to compute the monetary impact of the road blockage/destruction based on the **extent of the hazard, the road type (e.g. motorway, trunk, primary roads), and the number of lanes.**\n",
+ "\n",
+ "To run the FIAT model on a road network it is necessary to create the [exposure data](https://github.com/Deltares/Delft-FIAT/blob/master/docs/user_guide/data/exposure.qmd) and [vulnerability data](https://github.com/Deltares/Delft-FIAT/blob/master/docs/user_guide/data/vulnerability.qmd).\n",
+ "\n",
+ "**Notebook Output**: \n",
+ "The output of this notebook will be: \n",
+ "- `exposure data`\n",
+ "- `vulnerability data` \n",
+ "\n",
+ " which are neccessary to run the FIAT model for various events and scenarios of a flood event on a road network.\n",
+ "\n",
+ "\n",
+ ">*Note: This notebook will cover the road impact assessment based on Open Sreet Map (OSM) data."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Let's get started!**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Step 1**: Import required packages"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# First, all required packages must be installed.\n",
+ "\n",
+ "from hydromt_fiat.fiat import FiatModel\n",
+ "from hydromt.log import setuplog\n",
+ "from pathlib import Path\n",
+ "import geopandas as gpd\n",
+ "import pandas as pd\n",
+ "import os \n",
+ "import json\n",
+ "import yaml\n",
+ "from hydromt.config import configread\n",
+ "from shapely.geometry import Polygon\n",
+ "import matplotlib.pyplot as plt"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Step 2:** Data Input"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "To run FIAT the user must provide data about the road network and the sudy area of interest;\n",
+ "- Polygon of the region of interest (from the coordinates we will create a shapely polygon)\n",
+ "- Information on the road network within the study area (geospatial file format e.g. *.shp, *.geojson, *.gpkg ):\n",
+ " - road type\n",
+ " - number of lanes\n",
+ " - segment length\n",
+ "- Model configuration (see section **Step 2b: Create configuration file**) "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Step 2a:** Define the study area"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "FIAT requires the input of a region in form of a **shapely Polygon** to download the **OSM road dataset**. This can be done via **vector file** or **GeoJSON object** of the study area. We recommened to download the region from [Geojson.io](https://geojson.io/#map=2/0/20). \n",
+ "\n",
+ "**GeoJson.io** \n",
+ "Draw a polygon on the map and create a polygon from the GeoJson Object. You can download a vector file, you need to refer to in the \"region\" tab in the *yaml* file using the file path. You can also copy the GeoJson code directly into the configuration file (see example in [configuration file](C:/Users/rautenba/hydromt_fiat/examples/data/road_network/configuration.yml)).\n",
+ "\n",
+ "![Region_download.PNG](../docs/_static/charelston.PNG.svg)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create a dictionary of the GeoJson Object\n",
+ "\n",
+ "region = {\n",
+ " \"type\": \"FeatureCollection\",\n",
+ " \"features\": [\n",
+ " {\n",
+ " \"type\": \"Feature\",\n",
+ " \"properties\": {},\n",
+ " \"geometry\": {\n",
+ " \"type\": \"Polygon\",\n",
+ " \"coordinates\": [\n",
+ " [\n",
+ " [-79.96177042294748, 32.79061007407526],\n",
+ " [-79.96177042294748, 32.76748645567278],\n",
+ " [-79.91724162366485, 32.76748645567278],\n",
+ " [-79.91724162366485, 32.79061007407526],\n",
+ " [-79.96177042294748, 32.79061007407526],\n",
+ " ]\n",
+ " ],\n",
+ " },\n",
+ " }\n",
+ " ],\n",
+ "}\n",
+ "\n",
+ "# Extract the coordinates\n",
+ "coordinates = region[\"features\"][0][\"geometry\"][\"coordinates\"]\n",
+ "\n",
+ "# Create a Shapely Polygon\n",
+ "polygon = Polygon(coordinates[0]) # Extract the coordinates of the exterior ring"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## **Step 2b:** Create the configuration file"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "We must configure the FIAT model form of a `yaml`-file or a dictionary, in which the model parameters are defined. The configuration file must define the **vulnerability** and **exposure setup**. \n",
+ "The required fields are:\n",
+ " \n",
+ "*setup_road_vulnerability:*\n",
+ "- **vertical_unit**:Unit of vertical inundation (feet or meter)\n",
+ "- **threshold_value**: Threshold inundation height at which road is fully destroyed \n",
+ "- **min_hazard_value**: minimum inundation height (recommended: 0)\n",
+ "- **max_hazard_value**: maximum inundation height (e.g. 6 meters) \n",
+ "- **step_hazard_value**: discrete levels or steps of inundation height\n",
+ "\n",
+ "*setup_exposure_roads:*\n",
+ "- **roads_fn**: File path to road network file or OSM data (for OSM data use: \"OSM\")\n",
+ "- **road_types**: Road type keys (if OSM data use keys from from OSM e.g. \"motorway\", \"primary\")\n",
+ "- **road_damage**: Damages per lane and per length unit\n",
+ "- **unit**: Unit of road length (feet or meter)\n",
+ "\n",
+ "The provided parameters need to be incorporated into the YAML structure. Please check [here](C:/Users/rautenba/hydromt_fiat/examples/data/road_network/configuration.yaml) for the setup of the *configuration.yml*. "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Load the configuration file"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "**This step is not necessary to run the model. It's just for visualization purposes.** \n",
+ "\n",
+ "The configuration file can be read in python and its information are converted into a python dictionary.
\n",
+ "
Note: Instead of loading a yaml file it is possible to create a python dictionary directly, built upon the structure seen below.
"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "{\n",
+ " \"setup_road_vulnerability\": {\n",
+ " \"vertical_unit\": \"feet\",\n",
+ " \"threshold_value\": 0.6,\n",
+ " \"min_hazard_value\": 0,\n",
+ " \"max_hazard_value\": 10,\n",
+ " \"step_hazard_value\": 1\n",
+ " },\n",
+ " \"setup_exposure_roads\": {\n",
+ " \"roads_fn\": \"OSM\",\n",
+ " \"road_types\": [\n",
+ " \"motorway\",\n",
+ " \"primary\",\n",
+ " \"secondary\",\n",
+ " \"tertiary\"\n",
+ " ],\n",
+ " \"road_damage\": \"default_road_max_potential_damages\",\n",
+ " \"unit\": \"meter\"\n",
+ " }\n",
+ "}\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Let's read the configuration file holding the required information for the FIAT model \n",
+ "with open(Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"configuration.yaml\", 'r') as file:\n",
+ " config = yaml.safe_load(file)\n",
+ "\n",
+ "print(json.dumps(config, indent=4, sort_keys=False))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Step 3**: Define variables for the FIAT model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "To build the model some settings must be ingested as variables. So you need to set up the root path to the FIAT model, the logger settings, the region and the data catalog:\n",
+ "- `root`: Directory path where the FIAT model data is stored. \n",
+ "- `logger`: The logger variable defines the frequencies of log-entries during the initialisation of the model.\n",
+ "- `region`: Define the region as a variable from the config dictionary.\n",
+ "- `data_catalog_yml`: Define the data catalogue as a variable from the config dictionary.\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:02,291 - hydromt_fiat - log - INFO - HydroMT version: 0.8.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Set up Fiat Model\n",
+ "root = Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"FIAT model\" \n",
+ "\n",
+ "# Set up the logger\n",
+ "logger = setuplog(\"hydromt_fiat\", log_level=10)\n",
+ "\n",
+ "# Set up datacatalog\n",
+ "data_catalog_yml = Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"hydromt_fiat_catalog_USA.yml\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Step 4:** Run the FIAT model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "It's time to run the road network FIAT model. The output will be stored in the root-directory. \n",
+ "\n",
+ "The output will be an **exposure folder** incl. `exposure.csv` together with vector data files, a **vulnerability folder** incl. `damage_curve.csv`, a **hazard folder** (empty) and an **output folder** (empty). \n",
+ "\n",
+ ">*Note*: Ignore the output folder (in this notebook only)! \n",
+ " In this example we don't provide any hazard data, so the `output folder` will be empty. In case hazard data is provided the `output` folder contains an updated `exposure.csv` with the damages of the event on the road segment."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,731 - hydromt_fiat - data_catalog - INFO - Parsing data catalog from c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\hydromt_fiat_catalog_USA.yml\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Parsing data catalog from c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\hydromt_fiat_catalog_USA.yml\n",
+ "WARNING:py.warnings:c:\\Users\\rautenba\\AppData\\Local\\mambaforge\\envs\\hydromt-fiat-dev\\lib\\site-packages\\hydromt\\data_adapter\\geodataframe.py:99: DeprecationWarning: Passing additional keyword arguments to be used by the GeoDataFrameAdapter driver is deprecated and will be removed in a future version. Please use 'driver_kwargs' instead.\n",
+ " warnings.warn(\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,744 - hydromt_fiat - model_api - WARNING - Model dir already exists and files might be overwritten: c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\exposure.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "WARNING:hydromt_fiat:Model dir already exists and files might be overwritten: c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\exposure.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,746 - hydromt_fiat - model_api - WARNING - Model dir already exists and files might be overwritten: c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\vulnerability.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "WARNING:hydromt_fiat:Model dir already exists and files might be overwritten: c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\vulnerability.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,749 - hydromt_fiat - model_api - INFO - Initializing fiat model from hydromt_fiat (v0.2.1.dev0).\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Initializing fiat model from hydromt_fiat (v0.2.1.dev0).\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,760 - hydromt_fiat - model_api - INFO - setup_region.region: {'geom': geometry\n",
+ "0 POLYGON ((-79.96177 32.79061, -79.96177 32.767...}\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_region.region: {'geom': geometry\n",
+ "0 POLYGON ((-79.96177 32.79061, -79.96177 32.767...}\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,763 - hydromt_fiat - basin_mask - DEBUG - Parsed region (kind=geom): {'geom': 'GeoDataFrame [-79.96177042 32.76748646 -79.91724162 32.79061007] (crs = EPSG:4326)'}\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "DEBUG:hydromt_fiat:Parsed region (kind=geom): {'geom': 'GeoDataFrame [-79.96177042 32.76748646 -79.91724162 32.79061007] (crs = EPSG:4326)'}\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,767 - hydromt_fiat - model_api - INFO - setup_road_vulnerability.vertical_unit: feet\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_road_vulnerability.vertical_unit: feet\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,768 - hydromt_fiat - model_api - INFO - setup_road_vulnerability.threshold_value: 0.6\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_road_vulnerability.threshold_value: 0.6\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,770 - hydromt_fiat - model_api - INFO - setup_road_vulnerability.min_hazard_value: 0\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_road_vulnerability.min_hazard_value: 0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,772 - hydromt_fiat - model_api - INFO - setup_road_vulnerability.max_hazard_value: 10\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_road_vulnerability.max_hazard_value: 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,773 - hydromt_fiat - model_api - INFO - setup_road_vulnerability.step_hazard_value: 1\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_road_vulnerability.step_hazard_value: 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,775 - hydromt_fiat - model_api - INFO - setup_exposure_roads.roads_fn: OSM\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_exposure_roads.roads_fn: OSM\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,776 - hydromt_fiat - model_api - INFO - setup_exposure_roads.road_damage: default_road_max_potential_damages\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_exposure_roads.road_damage: default_road_max_potential_damages\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,778 - hydromt_fiat - model_api - INFO - setup_exposure_roads.road_types: ['motorway', 'primary', 'secondary', 'tertiary']\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_exposure_roads.road_types: ['motorway', 'primary', 'secondary', 'tertiary']\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,779 - hydromt_fiat - model_api - INFO - setup_exposure_roads.unit: meter\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:setup_exposure_roads.unit: meter\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,781 - hydromt_fiat - exposure_vector - INFO - Setting up roads...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Setting up roads...\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,939 - hydromt_fiat - exposure_vector - INFO - The damage function 'roads' is selected for all of the structure damage to the roads.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:The damage function 'roads' is selected for all of the structure damage to the roads.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,941 - hydromt_fiat - data_catalog - INFO - DataCatalog: Getting default_road_max_potential_damages DataFrame csv data from c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\us_road_damage.csv\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:DataCatalog: Getting default_road_max_potential_damages DataFrame csv data from c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\us_road_damage.csv\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,943 - hydromt_fiat - dataframe - INFO - DataFrame: Read csv data.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:DataFrame: Read csv data.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,968 - hydromt_fiat - exposure_vector - INFO - Setting exposure geometries...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Setting exposure geometries...\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,970 - hydromt_fiat - exposure_vector - INFO - Setting geometry name to roads...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Setting geometry name to roads...\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,973 - hydromt_fiat - fiat - INFO - Updating all data objects...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Updating all data objects...\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,975 - hydromt_fiat - model_api - ERROR - Default config file not found at c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\fiat\\settings.toml\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "ERROR:hydromt_fiat:Default config file not found at c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\fiat\\settings.toml\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,977 - hydromt_fiat - model_api - WARNING - Replacing geom: region\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "WARNING:hydromt_fiat:Replacing geom: region\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,979 - hydromt_fiat - fiat - INFO - Writing model data to c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Writing model data to c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,980 - hydromt_fiat - model_api - INFO - Writing model config to c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\settings.toml\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Writing model config to c:\\Users\\rautenba\\hydromt_fiat\\examples\\data\\road_network\\FIAT model\\settings.toml\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:15,982 - hydromt_fiat - model_api - DEBUG - Writing file exposure/region.gpkg\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "DEBUG:hydromt_fiat:Writing file exposure/region.gpkg\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:16,070 - hydromt_fiat - model_api - DEBUG - Writing file exposure/roads.gpkg\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "DEBUG:hydromt_fiat:Writing file exposure/roads.gpkg\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:16,182 - hydromt_fiat - fiat - INFO - Writing model exposure table file to exposure/exposure.csv.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Writing model exposure table file to exposure/exposure.csv.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2023-10-31 14:00:16,187 - hydromt_fiat - fiat - INFO - Writing model vulnerability_curves table file to vulnerability/vulnerability_curves.csv.\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "INFO:hydromt_fiat:Writing model vulnerability_curves table file to vulnerability/vulnerability_curves.csv.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Build the FIAT model \n",
+ "fiat_model = FiatModel(root=root, mode=\"w+\", data_libs=[data_catalog_yml], logger=logger)\n",
+ "\n",
+ "region = gpd.GeoDataFrame.from_features(region, crs=4326)\n",
+ "opt = configread(Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"configuration.yaml\")\n",
+ "fiat_model.build(region={\"geom\": region}, opt=opt, write=False)\n",
+ "fiat_model.write()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# **Done!**\n",
+ "Your **FIAT model** created the exposure and vulnerability files for the road network. Using that data in combination with a hazard map, the impact for the defined hazard can be computed. \n",
+ "\n",
+ "Let's have a look at the output!"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
Make this Notebook Trusted to load map: File -> Trust Notebook
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 24,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# Load exposure.csv into dataframe\n",
+ "df_exposure = pd.read_csv(Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"FIAT model\" / \"exposure\" / \"exposure.csv\")\n",
+ "\n",
+ "# Load exposure geopackage into GeoDataFrame\n",
+ "gdf_exposure =gpd.read_file(Path(os.path.abspath(\"\")) / \"data\" / \"road_network\" / \"FIAT model\" / \"exposure\" / \"roads.gpkg\")\n",
+ "\n",
+ "# Merge dataframe with GeoDataFrame\n",
+ "merged_gdf = gdf_exposure.merge(df_exposure, left_on='Object ID', right_on='Object ID', how='inner')\n",
+ "\n",
+ "# Display the road network\n",
+ "road_network = merged_gdf.explore(column = 'Max Potential Damage: Structure')\n",
+ "road_network"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The vulnerability is translated into a step function, which is determined by the water level threshold. Water levels beyond the threshold result in untraversible road segments. \n",
+ "\n",
+ "We can have a look at the `vulnerability.csv` output and the vulnerability curve. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "