Skip to content

Quickstart

Emanuele Gissi edited this page Aug 30, 2021 · 30 revisions

This wiki page describes how to set up your QGIS installation to import terrain data from the US LANDFIRE program, and export it to a NIST FDS case file for wildfire numerical simulation. You can download a working golden_gate.gqs example file created following the steps of this example from here. This same file can be used to export to FDS any terrain available on LANDFIRE from the whole US.

LANDFIRE (Landscape Fire and Resource Management Planning Tools) is a shared program between the wildland fire management programs of the US Department of Agriculture - US Forest Service and the US Department of the Interior - Wildland Fire Management Bureau providing landscape scale geo-spatial products to support cross-boundary planning, management, and operations in the US.

NIST FDS Fire Dynamics Simulator (FDS) is a large-eddy simulation (LES) code for low-speed flows, with an emphasis on smoke and heat transport from fires. FDS is the product of an international collaborative effort led by the US Department of Commerce - National Institute of Standards and Technology (NIST).

Before starting

You should already have the QGIS application installed on your computer, and the qgis2fds plugin enabled. If not, this wiki page explains how to do that.

If you are completely new to geographic information systems (GIS), I suggest the following preliminary interesting reads:

Overview of the procedure

To predict the potential behavior and effects of wildland fire, we need, in addition to the slope of the terrain, a surface fire behavior and fire effects model. This model describes the fuel bed inputs such as load, bulk density, fuel particle size, thermal properties, and moisture content.

For this reason, we are going to link two LANDFIRE data sources to your QGIS installation:

  • the digital elevation model, a 3D representation of terrain surface created from terrain elevation data for the whole US,

  • and the landuse data that describes the vegetation fuel bed inputs.

Different kinds of fuel models are used in fire science (See: Joe H. Scott Robert E. Burgan, Standard Fire Behavior Fuel Models). In this example, we are going to add the landuse layer offering the 13 Anderson Fire Behavior Fuel Model (F13). The F13 can be used as input to Rothermel's surface fire behavior and spread model.

After that we are going to create a new QGIS project.

A QGIS project is composed of geographic data layers. Each data layer is projected on the map according to its coordinate reference system (CRS). Your QGIS project also has an associated CRS.

A CRS defines how the coordinates of the two-dimensional projected map is related to real places on Earth. The data layer author choses its CRS depending on the regional extent of the area they is working in.

The project CRS determines how data is projected from its underlying raw coordinates to the flat map rendered within the QGIS map canvas. QGIS supports on-the-fly CRS transformation for data layers. This means that regardless of the underlying CRS of particular data layers in your project they will always be automatically transformed into the common CRS defined for your project. Behind the scenes, QGIS transparently reprojects all the layers contained within your project into the project’s CRS so that they will all be rendered in the correct position with respect to each other. QGIS supports approximately 7,000 standard CRSs, each with a different use case. If you are wondering why so many CRSs have a reason to exist, read this specific chapter of A gentle introduction to GIS.

We then populate your new QGIS project with the LANDFIRE linked data sources, both elevation and landuse, and set the correct CRS for each. To facilitate the navigation on the map canvas, we can add an OpenStreetMap basemap layer on top.

At this point, all is ready for exporting the selected parcel of terrain to an FDS case.

So, let's start!

Step 1: Link LANDFIRE data sources to QGIS

Launch QGIS

and click on Layer > Data Source Manager in the main menu. Choose the WCS panel and click on the New button to create a new connection.

Type the following information in this panel:

Name: Landfire CONUS LF 2.0.0

URL: https://landfire.cr.usgs.gov/arcgis/services/Landfire/US_200/MapServer/WCSServer

Then click OK.

Repeat the same procedure for this second new WCS connection:

Name: Landfire CONUS Topographic

URL: https://landfire.cr.usgs.gov/arcgis/services/Landfire/US_other/MapServer/WCSServer

At the end close the Data Source Manager.

These two LANDFIRE data sources are now permanently added to your QGIS installation.

For further details on these and other LANDFIRE WCS servers offering data sources visit the LANDFIRE data access page.

Step 2: Create a new QGIS project

Click on Project > New in the main menu and start a new empty project.

Step 3: Populate the new QGIS project with data layers

Add the digital elevation model layer

Look at the Browser panel and open the WCS > Landfire CONUS Topographic list. Drag-and-drop the US_DEM2016 data source to the Layers panel of your project. A greyscale US map should appear in your project map canvas.

To setup this layer configuration, right-click on the US_DEM2016 layer name in the Layers panel and choose Properties. Its Layer Properties window opens up.

Select the Source label in the side panel. Then click on the small button to choose the right CRS for this layer.

The CRS selector opens up. Type EPSG:5070 in the filter field and select the NAD83/Conus Albers - EPSG:5070 CRS. Then click OK.

All LANDFIRE data sources for the Conus region use this NAD83/Conus Albers - EPSG:5070 CRS, as explained in the LANDFIRE FAQ.

Whenever a Select Transformation window opens up, just click OK to accept the default choice for transformations between the different layer and project CRSs.

When back in the Layer Properties window, select the Symbology label in the side panel. Choose Render type > Hillshade to improve the digital elevation model layer appearance.

Close the Layer Properties window by clicking the OK button on the bottom. You are back to the map canvas of your project.

If after setting up the CRS the US map has disappeared, zoom in that layer again by using View > Zoom to Layer in the main menu.

Add the landuse layer

As already done for the digital elevation model layer, look at the Browser panel and open the WCS > Landfire CONUS LF 2.0.0 list. Drag-and-drop the US_200F13_20 data source to the Layers panel of your project. Then in its Layer Properties window, set this layer CRS to NAD83/Conus Albers - EPSG:5070.

From the same Layer Properties window, select Symbology on the side panel. Load the Landfire F13.qml style by clicking on the Style > Load Style menu at the bottom of the window (if this style is not available, download it). If you want to see both the elevation and the landuse layers in your project map canvas, set Blending mode > Multiply.

The Landfire F13.qml style sets the appearance of the landuse layer to that of the LANDFIRE maps, using the right color for each of the 13 Anderson fuel models.

Close the Layer Properties window by clicking the OK button on the bottom. You are back to the map canvas of your project.

You can zoom in and pan to your desired location. For example, here is a view of landuse and elevation of the Golden Gate area in San Francisco, California.

Add the OpenStreetMap basemap layer

As already done for the previous layers, look at the Browser panel and open the XYZ Tiles list. Drag-and-drop the OpenStreetMap data source to the Layers panel of your project.

QGIS should automatically set the right CRS for this layer. Just in case, check it in its Layer Properties window. In general, the right CRS for web based maps is EPSG:3857 - WGS 84/Pseudo-Mercator.

If you are curious, This Wikipedia page explains why this CRS is a very good choice for web maps but not for other applications.

If you want to add other basemaps (eg. Google Maps, ...), enable the QuickMapServices QGIS plugin and follow its instructions.

Play with the Blending Mode in the Layer Properties > Symbology panel to obtain the following blended view of the Golden Gate area.

Step 3: Set your project CRS

By default QGIS sets a new project CRS to that of the first created data layer. As this is not always the best choice, let's set it to something different.

Click on Project > Properties in the main menu and select CRS on the side panel. Similarly to what you previously did, set your project CRS to WGS84 - EPSG:4326. The current project CRS is always displayed in the bottom-right corner of the map canvas of your project.

The WGS84 CRS offers latitude-longitude coordinates and is very popular in mobile mapping applications and outdoor GPS devices.

Step 4: Export the terrain to an FDS case

Look at the Processing Toolbox panel and double click on the Export to NIST FDS > Export terrain tool.

Then fill in the required informations in the qgis2fds main panel:

Set exporting parameters

Here is some guidance on each parameter:

  • FDS Case identificator (CHID): the name of the FDS case and of the terrain. This string is used as FDS case filename and as HEAD and GEOM namelist identificators IDs.

  • Save in folder: this is the destination folder of all the exported files of the FDS case. You can also use a relative path as ./fds.

  • Terrain Extent: here you can specify the geographic extent of the exported terrain on the map canvas. You can choose the extent of one of the existing layers, the map canvas extent or select the extent with the cursor on the map canvas. The terrain extent is specified in a comment in the FDS case file in UTM CRS.

  • DEM Layer: select the layer containing the digital elevation model of the terrain, in this case it is US_DEM2016.

  • Landuse Layer: select the layer describing the landuse of the terrain, in this case it is US_200F13_20.

  • Landuse Layer Type: specify the type of data contained in the landuse layer, in this case we are using the Landfire F13 data dictionary that expresses the fuel models with integer numbers in the range 0-99. Other options are offered for different landuse descriptions (eg. CIMA Propagator dataset for Italy).

  • Advanced Parameters

    • DEM Layer sampling factor: if the DEM Layer is too dense, set this factor to 2 or more to downsample it.

    • Domain Origin: specify the geographic location of the origin of the FDS case reference system. Note that if you click on the ... button to the right of the Domain Origin field then you can use your mouse to click on the location within the scene (you may have to move the Export terrain dialog first). If not set, the terrain extent centroid is used. The domain origin location is added to the MISC namelist in the FDS case file.

    • Fire Origin: specify the geographic location of fire ignition. Similar to Domain Origin, if you click the ... button you can use your mouse to specify the point of Fire Origin. If not set, the domain origin is used. At the location of the fire ignition qgis2fds applies a square VENT patch on the terrain in the FDS case file.

    • Texture Layer: select the layer that should be exported as terrain texture. If this is not set, current map canvas view is exported.

    • Texture Layer pixels size: set the resolution of the texture map. A larger value is coarser resolution. We suggest using values around 10 meters per pixel. Higher resolution images may not load from the texture layer provider (eg. OpenStreetMap or Google Maps) and this will cause the terrain export to hang.

    • Max number of FDS MESHes: set the maximum number of MESHes that are going to split the domain; this is used to allow parallel calculation.

    • Desired FDS MESH cell size (in meters): set the MESH cell size, calculating IJK accordingly.

    • Wind *.csv file: specify the comma-separated values file (*.csv) that contains the WIND data. You can create this with Libreoffice Calc or MS Office Excel. The file should have an header row and three columns containing: time in seconds, wind speed in m/s, and wind direction in degrees. For example:

Time,Speed,Direction
0,2,45
180,5,90
360,10,135

In this example, we have chosen Slacker Hill as the domain origin and a point just south as the fire origin.

Click Run

After clicking on the Run button, the plugin starts crunching numbers.

Here is a short description of the phases of the export process:

  • first, qgis2fds creates a grid of points over the DEM Layer, using the same orientation and its pixel density; for each of these points, the plugin samples the elevation values from the DEM Layer and the landuse from the Landuse Layer;

  • then it reprojects the grid of points to the locally optimized UTM CRS;

The UTM system provides a constant distance relationship anywhere on the map, while in angular coordinate systems, like latitude and longitude, the distance covered by a degree of longitude differs as you move towards the poles and only equals the distance covered by a degree of latitude at the equator. The UTM system allows the coordinate numbering system to be tied directly to a distance measuring system. And all UTM coordinates are measured in meters.

  • the reprojected points are used as centers of quad faces that entirely fill the chosen terrain extent; the quad faces are split into triangles and the landuse values are assigned as their FDS boundary condition.

At the end of the process, a working FDS case file is written to disk.

The file contains all it needs to run smoothly in FDS without modification. But, of course, it needs specific customization. This can be accomplished in BlenderFDS, the free and open source user interface for FDS.

A temporary layer of the sampled points is created in the QGIS project. This layer can be removed, if not needed.

The case directory contains the textured image of the terrain, too. The image can be projected by Smokeview over the terrain, instead of the colors of the boundary conditions, to facilitate the interpretation of the wildfire simulation results.

Step 5: Run FDS

Running the FDS solver on the unmodified created case, the Smokeview setup is performed.

By opening the case in Smokeview, you can appreciate the result of your hard work. Here are the Golden Gate terrains, with and without the automatically created texture applied.

Step 6: Save the world

This is by large the most important step.

The impact of the climate emergency is in front of us. In 2020 bushfires have killed people and forced thousands to flee their homes. Many areas of the world saw record temperatures last summer and winter. The qgis2fds plugin is a small open source contribution to the protection of our beloved planet from wildfires.

Clone this wiki locally