INSPIRE Flood Warning Assistant Tutorial Exercise 3: Extend Web App

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2019.x

Introduction

This will demonstrate how the Flood Warning and Impact Assistant web app can be easily extended to support new datasets and new types of impact assessments.

The overall goal of the workspace in this exercise (floodMaps2html.fmw) is to read flood data and impact features, and generate flood and impact detail reports based on the user's selections. The core of the process is a series of SpatialFilters that check to see if the impact features of interest fall within a flood risk zone.

 

Step-by-step Instructions

1. Download the Exercise 3 Workspaces and Data

Download the Exercise 3 workspaces and data. Once downloaded, open floodMaps2html - Start.fmw in FME Workbench.

 

2. Edit Published Parameters

Edit the publish parameter 'IMPACTTYPE' in the Workbench Navigator pane and add the 'infrastructure' option if it isn't already there. Do this by right-clicking on the parameter and selecting 'Edit Definition'. Then set the configuration to be: 'None%Roads%Junctions%Infrastructure'

1571783704617.png

 

3. Edit the TestFilter

Next, edit the TestFilter transformer within the '3. Read impact layers if selected' bookmark. Add an $(IMPACTTYPE) = 'infrastructure' condition with an output port = infrastructure. This handles the case where the user selects infrastructure for impact analysis.

1571784017292.png

 

4. Add a FeatureReader

Now add a new FeatureReader and connect the TestFilter infrastructure output to the FeatureReader input.

Configure the FeatureReader to read the .\results\infrastructure.gpkg geopackage database as follows:

1571784176840.png

 

5. Add a Tester

Add a Tester, connect the infrastructure output of the FeatureReader to its input, and filter on the infrastructureType (attribute) = 'FunctionalSite' (value).

 

6. Duplicate the SpatialFilter

Right-click on SpatialFilter_3 and select duplicate. Connect the output of GeographicBufferer_2 to its Filter input port and the output of the Tester you just added to the Candidate input port.

 

7. Add an AttributeCreator

Add an AttributeCreator, connect the output of the SpatialFilter to it. Edit the AttributeCreator and define a field called _label and set its value to '@Value(distinctiveName) Type @Value(classification) Flood @Value(filter_floodAreaID) Date @Value(filter__date)'.

1571784628325.png

 

8. Duplicate the HTMLReportGenerator

Right-click on HTMLReportGenerator_3 and select 'duplicate'. Connect the output of the new AttributeCreator to it. Edit the Table page content element to be configured as follows:

1571784817298.png

 

9. Connect the new HTMLReportGenerator

Connect the output of the new HTMLReportGenerator to Tester_2 and another output from the same port to the input of the green NoFeaturesTester_2.

 

10. Run the Workspace

Your workspace should look as below. To test it, run the workspace and select the infrastructure input type. You should then see a report of all the infrastructure sites potentially affected by any floods in your area of interest. If there are no floods, you will simply get a circle depicting the area of interest and a single record stating no data available.

1571785141815.png

 

Completed workspace for exercise 3:

The following is an example of the type of impact report output you might see if you run the workspace with default location settings, choose flood type = past floods, and impact type= infrastructure. Note the schools and medical facilities as potentially impacted by the flood in question.

1571785795172.png

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.