You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ └── sampledata/ # Contains the sample data to demonstrate how this frameworks works
32
32
│ └── fimeval_usage.ipynb #Sample code usage of the Evaluation framework
33
+
│ └── fimbench_usage.ipynb #Sample code usage of the FIMbench Query and getting benchmark dataset
33
34
├── Images/ # have sample images for documentation
34
35
├── src/
35
-
│ └── fimeval/
36
+
│ └── fimeval/
37
+
│ ├──BenchFIMQuery/ #Module to interact with the extensive FIMdatabase, hosted in AWS S3
38
+
│ │ └── access_benchfim.py #Different classes to query right benchmark FIM for any given location and set of filter
39
+
│ │ └── utilis.py #Support utility
36
40
│ ├──BuildingFootprint/ # Contains the evaluation of model predicted FIM with microsoft building footprint
37
-
│ │ └── microsoftBF.py
41
+
│ │ └── arcgis_API.py #seamless integration of building footprint in evaluation through ArcGIS REST API
38
42
│ │ └── evaluationwithBF.py
39
43
│ └── ContingencyMap/ # Contains all the metrics calculation and contingency map generation
40
44
│ │ ├── evaluationFIM.py # main evaluation moodule
41
45
│ │ └── methods.py # Contains 3 different methods of evaluation
42
46
│ │ └── metrics.py # metrics calculation module
43
47
│ │ └── plotevaluationmetrics.py # use to vizualize the different performance metrics
44
48
│ │ └── printcontingency.py # prints the contingency map to quickly generate the Map layout
45
-
│ │ └── PWBs3.py # module which helps to get permanent water bodies from s3 bucket
49
+
│ │ └── water_bodies.py # module which to get permanent water bodies from s3 bucket and ArcGIS REST API
46
50
│ └── utilis.py #Includes the resampling and reprojection of FIMs
47
51
└── tests/ # Includes test cases for different functionality
48
52
```
49
53
The graphical representation of fimeval pipeline can be summarized as follows in **```Figure 1```**. Here, it will show all the steps incorporated within the ```fimeval``` during packaging and all functionality are interconnected to each other, resulting the automation of the framework.
This framework uses PWB to first to delineate the PWB in the FIM and assign into different class so that the evaluation will be more fair. For the Contiguous United States (CONUS), the PWB is already integrated within the framework however, if user have more accurate PWB or using fimeval for outside US they can initialize and use PWB within fimeval framework. Currently it is using PWB publicly hosted by ESRI: https://hub.arcgis.com/datasets/esri::usa-detailed-water-bodies/about
98
+
This framework uses PWB to first to delineate the PWB in the FIM and assign into different class so that the evaluation will be more fair. For the Contiguous United States (CONUS), the PWB is already integrated within the framework however, if user have more accurate PWB or using fimeval for outside US they can initialize and use PWB within fimeval framework. Currently it is using PWB publicly hosted by ESRI through REST API: https://hub.arcgis.com/datasets/esri::usa-detailed-water-bodies/about
95
99
96
100
If user have more precise PWB, they can input their own PWB boundary as .shp and .gpkg format and need to assign the shapefile of the PWB and define directory as,
97
101
```bash
@@ -136,7 +140,7 @@ Table 1: Modules in `fimeval` are in order of execution.
136
140
| `EvaluateFIM` | It runs all the evaluation of FIM between B-FIM and M-FIMs. | `main_dir`: Main directory containing the case study folders, <br> `method_name`: How users wants to evaluate their FIM, <br> `outpur_dir`: Output directory where all the results and the intermidiate files will be saved for further calculation, <br> *`PWB_dir`*: The permanenet water bodies vectory file directory if user wants to user their own boundary, <br> *`target_crs`*: this fimeval framework needs the floodmaps to be in projected CRS so define the projected CRS in epsg code format, <br> *`target_resolution`*: sometime if the benchmark is very high resolution than candidate FIMs, it needs heavy computational time, so user can define the resolution if there FIMs are in different spatial resolution, else it will use the coarser resolution among all FIMS within that case. |The outputs includes generated files in TIFF, SHP, CSV, and PNG formats, all stored within the output folder. Users can visualize the TIFF files using any geospatial platform. The TIFF files consist of the binary Benchmark-FIM (Benchmark.tif), Model-FIM (Candidate.tif), and Agreement-FIM (Contingency.tif). The shp files contain the boundary of the generated flood extent.|
137
141
|`PlotContingencyMap`| For better understanding, It will print the agreement maps derived in first step. |`main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding contingency raster for printing.| This prints the contingency map showing different class of evaluation (TP, FP, no data, PWB etc). The outputs look like- Figure 4 first row.|
138
142
|`PlotEvaluationMetrics`| For quick understanding of the evaluation metrics, to plot bar of evaluation scores. |`main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding file for printing based on all those info.| This prints the bar plots which includes different performance metrics calculated by EvaluateFIM module. The outputs look like- Figure 4 second row.|
139
-
| `EvaluationWithBuildingFootprint` | For Building Footprint Analysis, user can specify shapefile of building footprints as .shp or .gpkg format. By default it consider global Microsoft building footprint dataset. Those data are hosted in Google Earth Engine (GEE) so, It pops up to authenticate the GEE account, please allow it and it will download the data based on evaluation boundary and evaluation is done. | `main_dir`, `method_name`, `output_dir`: Those arguments are as it is, same as all other modules. <br> *`building_footprint`*: If user wants to use their own building footprint file then pass the directory here, *`country`*: It is the 3 letter based country ISO code (eg. 'USA', NEP' etc), for the building data automation using GEE based on the evaluation extent, *`shapefile_dir`*: this is the directory of user defined AOI if user is working with their own boundary and automatic Building footprint download and evaluation, *`geeprojectID`*: this is the google earth engine google cloud project ID, which helps to access the GEE data and resources to work with building footprint download and process. | It will calculate the different metrics (e.g. TP, FP, CSI, F1, Accuracy etc) based on hit and miss of building on different M-FIM and B-FIM. Those all metrics will be saved as CSV format in `output_dir` and finally using that info it prints the counts of building foorpint in each FIMs as well as scenario on the evaluation end via bar plot.|
143
+
| `EvaluationWithBuildingFootprint` | For Building Footprint Analysis, user can specify shapefile of building footprints as .shp or .gpkg format. By default it consider global Microsoft building footprint dataset hosted in ArcGIS Online. It is seamlessly integrated within framework through ArcGIS REST API. | `main_dir`, `method_name`, `output_dir`: Those arguments are as it is, same as all other modules. <br> *`building_footprint`*: If user wants to use their own building footprint file then pass the directory here, *`shapefile_dir`*: this is the directory of user defined AOI if user is working with their own boundary and automatic Building footprint download and evaluation,| It will calculate the different metrics (e.g. TP, FP, CSI, F1, Accuracy etc) based on hit and miss of building on different M-FIM and B-FIM. Those all metrics will be saved as CSV format in `output_dir` and finally using that info it prints the counts of building foorpint in each FIMs as well as scenario on the evaluation end via bar plot.|
|  | Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama.
Copy file name to clipboardExpand all lines: docs/fimeval_usage.ipynb
+21-9Lines changed: 21 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -238,7 +238,7 @@
238
238
" This directory where all the output as well as intermidiate files will be saved.\n",
239
239
"\n",
240
240
"4. **Building Footprint** \n",
241
-
" The directory of the building footprint (in vector format) used for FIM evaluation with buildings. Within the ```fimpef``` the microsoft derived global building footprint is integrated, so if user didnot provide any and willing to evaluate with it, it can automatically retrieve and do further analysis. Currently it uses ```msfootprint``` framework (https://github.com/supathdhitalGEO/msfootprint) to retrieve the data. \n",
241
+
" The directory of the building footprint (in vector format) used for FIM evaluation with buildings. Within the ```fimeval``` the microsoft derived global building footprint is integrated, so if user didnot provide any and willing to evaluate with it, it can automatically retrieve using ArcGIS Hosted Feature Layer through REST API. \n",
242
242
"\n",
243
243
" If user have better preference, they can use their own data as well. \n",
244
244
"\n",
@@ -333,7 +333,13 @@
333
333
"outputs": [],
334
334
"source": [
335
335
"#For instance\n",
336
-
"method_name = \"smallest_extent\""
336
+
"method_name = \"smallest_extent\"\n",
337
+
"\n",
338
+
"#If the candidate and benchmark resolution are different, user can define them here\n",
339
+
"target_resolution = 10 #WIll be in meters\n",
340
+
"\n",
341
+
"#By default, for CONUS it uses 5070 projection, in other region user can define the projection here\n",
342
+
"target_crs = \"EPSG:32633\" #WIll be in EPSG code"
337
343
]
338
344
},
339
345
{
@@ -358,10 +364,16 @@
358
364
"metadata": {},
359
365
"outputs": [],
360
366
"source": [
367
+
"\"\"\"\n",
368
+
"USE ONE OF THE OPTION BASED ON REQUIREMENT\n",
369
+
"\"\"\"\n",
361
370
"fp.EvaluateFIM(main_dir, method_name, output_dir) #It uses the default Permanent Water Bodies (PWB) dataset for United States.\n",
362
371
"\n",
363
372
"# #If the User has their PWB shapefile, then give the following argument\n",
"**For building automation, need to install java runtime (preferred version is 8: https://www.java.com/en/download/manual.jsp). For Windows need to setup the path and environmental variables carefully to avoid the RunTimeError**"
444
+
"**For building automation**"
433
445
]
434
446
},
435
447
{
@@ -439,13 +451,13 @@
439
451
"outputs": [],
440
452
"source": [
441
453
"# FIM Evaluation with Building Footprint (by default, it uses the Microsoft Building Footprint dataset)\n",
442
-
"#3 letter country ISO code\n",
443
-
"countryISO = \"USA\" #For instance\n",
444
-
"geeprojectID = \"your_gee_project_id\" # Replace with your actual GEE cloud project ID\n",
0 commit comments