Calculating Vegetation Indices in FME: Analyzing Wildfire Impact with NBR

Sydney Dombowsky
Sydney Dombowsky
  • Updated

Introduction

NBR is a vegetation index that uses the spectral properties of satellite imagery to assess burn severity and vegetative regrowth. In this tutorial, we will use FME to calculate this index for a wildfire, compare values from before and after the fire, and write the calculated values to a raster file and statistical calculations to a CSV file. We will use Landsat 8 imagery from before the fire, immediately after the fire, and five years post-fire to evaluate burn severity and vegetation recovery.

The fire we will be studying in this tutorial is the Elephant Hill fire, near Cache Creek, British Columbia, that burned just under 500,000 acres. The affected area had been heavily impacted by the mountain pine beetle epidemic, which increased fuel loads and overall flammability.

The data from the wildlife includes satellite imagery taken from three days:

  • PRE_20170705_B#
    • Imagery captured on July 5, 2017, before the fire began
  • POST_20171002_B#
    • Imagery captured on October 2, 2017, a few weeks after the fire was eliminated 
  • 5YRS_20220728_B#
    • Imagery captured on July 28, 2022, five years after the fire

Normalized Burn Ratio (NBR)

Normalized Burn Ratio (NBR) is used to identify burned areas and calculate burn severity. It uses SWIR (short-wave infrared) and NIR (near infrared) values in its calculation. The formula is written as:

NBR = (NIR - SWIR) / (NIR + SWIR)

This tutorial uses Landsat 8 imagery, where Band 5 is NIR and Band 7 is SWIR, resulting in the following formula:

NBR = (Band 5 - Band 7) / (Band 5 + Band 7)

High NBR values indicate healthy vegetation, which reflects strongly in NIR and less in SWIR. Low NBR values indicate higher burn severity as soil and charred wood reflect more in SWIR and less in NIR.

Source: USDA Forest Service, Remote Sensing Applications Center (RSAC)

dNBR (differenced Normalized Burn Ratio) is a change index, comparing NBR values before and after a fire. This is calculated as:

dNBR = NBR[pre] - NBR[post]

Positive dNBR values indicate high burn severity (high NBR before fire, low NBR after), near-zero values indicate little change, and negative values indicate increased vegetation.

The source data and workspace template for this tutorial can be downloaded from the Downloads section.

Downloads

The source data and workspace template can be downloaded here:

NBRSourceData.zip (134.8 MB)

CalculatingNBR.fmwt (134.8 MB)

 

Video

This video was recorded using FME 2025.2

 

Step-by-Step Instructions

In this tutorial, we will calculate NBR and dNBR to compare satellite imagery before and immediately after the fire, as well as between post-fire imagery and 5 years post-fire imagery to determine wildfire impact and vegetation recovery over time. 

 

1. Add Raster Imagery

Open FME Workbench and create a New workspace. 

Click the Reader button from the Toolbar. In the Add Reader dialog, enter the following:

  • Format: GeoTIFF (Geo-referenced Tagged Image File Format)
  • Dataset: /SourceData/Rasters/SelectAllFiles
    • Click on the blank document icon and browse to the Rasters folder and select all 6 files

  • Parameters
    • Feature Type Name(s): From File Name(s)

Then click OK.

In the Select Feature Types (Raster File) dialog, ensure all the files are selected, then click OK.

 

2. Calculate NBR with a RasterExpressionEvaluator

NBR (Normalized Burn Ratio) is a burn severity index that is calculated using NIR and SWIR values. The formula is:

NBR = (NIR - SWIR) / (NIR + SWIR)

For Landsat 8 imagery, the band association results in the following formula:

NBR = (Band 5 - Band 7) / (Band 5 + Band 7)

Type "RasterExpressionCalculator" onto the canvas, then press Enter on the keyboard to add the transformer to the workspace. Double-click the transformer to open the parameters. In the dialog window, set the following:

  • Mode: Two Rasters
  • Interpretation: Auto
  • Expression

    (A[0]-B[0])/(A[0]+B[0])
    • This expression takes two inputs to the transformer: A and B, which we will connect to Band 5 and Band 7, respectively

Connect the pre-fire Band 5 reader feature type (PRE_20170705_B5) to the RasterExpressionEvaluator A input port. Then, connect the pre-fire Band 7 reader feature type (PRE_20170705_B7) to the RasterExpressionEvaluator B input port.

Right-click the RasterExpressionEvaluator transformer and click Duplicate. Do this twice and repeat the connection process, but with the post-fire data and the 5 years post-fire data:

  • Connect POST_20171002_B5 to input port A on the duplicated transformer (RasterExpressionEvaluator_2) and POST_20171002_B7 to input port B. 
  • Connect 5YRS_20220728_B5 to input port A on the third duplicated transformer (RasterExpressionEvaluator_3) and 5YRS_20220728_B7 to input port B.

The workspace should now look like this:

The RasterExpressionEvaluator outputs a new single-band raster where each pixel value is the result of the NBR calculation.

 

3. Calculate dNBR Difference Index

With the NBR calculations complete, we can now calculate dNBR to assess the changes in burn severity and vegetative growth before and after the fire.

The formula for dNBR is:

dNBR = NBR[pre] - NBR[post]

This gives us positive values where burning was severe, negative values where there was regrowth, and values of zero where there was no change.

Add a new RasterExpressionEvaluator, not duplicated since we will be using a different expression, to the workspace.

Open the parameters and set the following:

  • Mode: Two Rasters
  • Interpretation: Auto
  • Expression

    A[0]-B[0]
    • This expression takes two inputs to the transformer: A and B, which we will connect to the pre- and post-fire NBR calculations

Connect the pre-fire NBR (RasterExpressionEvaluator) Result output port to the newly added RasterExpressionEvaluator_4 A input port. Then, connect the post-fire NBR (RasterExpressionEvaluator_2) Result output port to the RasterExpressionEvaluator_4 B input port:

This will give us the change in NBR from before the wildfire compared to immediately after. We are also interested in assessing regrowth after the fire, which we will use the same calculation for. This time we will compare the post-fire NBR and 5 years post-fire NBR. 

Duplicate RasterExpressionEvaluator_4 (dNBR calculation). Connect the post-fire NBR (RasterExpressionEvaluator_2) Result output port to the duplicated RasterExpressionEvaluator_5 A input port. Connect the 5 years post-fire NBR (RasterExpressionEvaluator_3) Result output port to the RasterExpressionEvaluator_5 B input port.

The workspace with dNBR calculations added should look like this:

 

4. Write Results to GeoTIFF 

We want to have the results of the change indices written to GeoTIFF format for comparative analysis. 

To add a writer, click the Writer button in the Toolbar. Set the following parameters in the Add Writer dialog:

  • Format: GeoTIFF (Geo-referenced Tagged Image File Format)
  • Dataset: /Output
    • Browse to select the desired output directory

Click OK. In the Feature Type dialog, set the file name:

  • Raster File Name: dNBR_pre_post

Duplicate this writer and change the file name to dNBR_post_5yrs:

  • Raster File Name: dNBR_post_5yrs

Connect the RasterExpressionEvaluator_4 (dNBR) Result output port to the dNBR_pre_post writer feature type. Then, connect the RasterExpressionEvaluator_5 (dNBR) Result output port to the dNBR_post_5yrs writer feature type:

This will result in two black and white raster files of the area, with each pixel representing a different value based on the dNBR calculations.

 

5. Clip Result to Fire Boundary

In addition to the raster outputs, we want a CSV file that highlights key statistics related to the burn area. The first step to calculate statistics is to clip the full raster image to the fire perimeter. 

Add the FirePerimeter dataset using a Reader:

  • Format: Esri Shapefile
  • Dataset: /SourceData/FirePerimeter/FirePerimeter.shp

Add a Clipper transformer and connect the FirePerimeter reader feature type to the Clipper Clipper input port. Connect the dNBR RasterExpressionEvaluator_4 (pre- to post-fire dNBR) Result output port to the Clipper Candidate input port. 

Add another Clipper and repeat the process with the RasterExpressionEvaluator_5 (post- to 5 years post-fire dNBR) transformer.

The output of the Clipper will be the dNBR raster in the shape of the fire perimeter polygon.

 

6. Calculate Statistics with RasterStatisticsCalculator

For the fire area, we want to know the average dNBR values to help determine if there was vegetation growth/loss (negative or positive values). To calculate the mean of raster values, we can use a RasterStatisticsCalculator.

Connect the first Clipper Inside output port to a RasterStatisticsCalculator Input port. In the parameters, select Mean as the statistic to calculate:

Add another RasterStatisticsCalculator with the Statistics to Calculate set to Mean. Connect the Clipper_2 Inside output port to the RasterStatisticsCalculator_2 Input port.

 

7. Create New Attributes to Write

In the output CSV file, we want to indicate which index was used on what data and the mean for that area. We will add these two attributes and assign them values, as well as remove unnecessary attributes using an AttributeManager. 

Add an AttributeManager and connect its Input port to the first RasterStatisticsCalculator Output port. Open the AttributeManager parameters and add a new attribute:

Output Attribute Value
index_name dNBR_pre_post
mean
@round(@Value(band0.mean),3)

For the purpose of this tutorial, the mean dNBR value is rounded to enhance readability. To write the full result to the CSV, simply use the @Value(band0.mean) attribute instead.

Use the Move Up button to reorganize the attributes so index_name and mean are at the top of the list. Then, remove the remaining attributes using the Action column drop-down:

Input Attribute Action
fme_basename Remove
_clipped Remove
band0.mean Remove

⁣We reordered the list of attributes because, if we removed band0.mean before the mean attribute was written, it would have no value to reference as the attribute would not exist at that time.

 

Duplicate the AttributeManager and connect its Input port to the RasterStatisticsCalculator_2 Output port. Open the parameters and change the index_name value from dNBR_pre_post to dNBR_post_5yrs:

Output Attribute Value
index_name dNBR_post_5yrs

 

8. Remove Geometry with GeometryRemover

The final step before we can write the statistics to a CSV file is to remove the geometry. This is important as CSV does not support raster geometry and expects attributes only.

Add a GeometryRemover transformer and connect both AttributeManager Output ports to the GeometryRemover Input port:

 

9. Write to CSV

Finally, we will write the statistics output to a CSV file. Add a writer and set the following parameters:

  • Format: CSV (Comma Separated Value)
  • Dataset: /Output
    • Browse to the output folder

Click OK. In the Feature Type dialog, set the file name:

  • File Name: FireStatistics

Connect the GeometryRemover Output port to the FireStatistics writer feature type. The drop-down arrow on FireStatistics should have two attributes listed: index_name and mean.

 

10. Run Workspace and View Output

Click the green Run button in the Toolbar. Open FME Data Inspector to view the output. Add both dNBR_pre_post.tif and dNBR_post_5yrs.tif to the display. Then add the FirePerimeter shapefile. 

Click the four-square geometry button under the FirePerimeter shapefile in the Display Control window. In the Geometry Drawing Styles dialog, set the following parameters for viewing the fire area: 

  • Pen Color: 255,0,0
  • Pen Width: 2
  • Fill Opacity: 0

Click OK. These settings allow us to see the fire perimeter overlaid on top of the dNBR raster. Toggle on and off the dNBR rasters to compare pre- to post-fire changes and post- to 5 years post-fire changes.

Higher dNBR values (colored white) indicate burning in the time period, whereas lower dNBR values (colored black) indicate vegetative growth.

Now, preview the CSV file in FME Data Inspector. In the Table View, there should be two rows, one for each index we calculated.

A positive average dNBR from before to immediately after the fire indicates the area was burned, which aligns with what we know about the area. With a negative average dNBR from immediately after the fire to 5 years after the fire, we can conclude that the area experienced some level of vegetative recovery over the years after it burned.

To further this tutorial, you could write the NBR rasters to GeoTIFF and add them to the statistical analysis, which could be used to quantify the loss and regrowth of vegetation. Additionally, incorporating the use of NDVI (Normalized Difference Vegetation Index) could provide more insight into vegetation recovery as an index that measures vegetative greenness.

 

Additional Resources

RasterStatisticsCalculator Transformer Documentation

RasterExpressionEvaluator Transformer Documentation

Raster Calculations and Raster Palettes Article

 

Data Attribution

This tutorial contains Landsat data in the public domain courtesy of the U.S. Geological Survey and wildfire perimeter data from the BC Wildfire Service licensed under the Open Government License - British Columbia

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.