Monday, February 20, 2012

Simple method to count trees using Saga GIS

It is possible to make a rough estimation of the number of trees in an area from LiDAR derived digital surface (DSM) and digital terrain models (DTM). One method is to use some of the grid analysis modules algorithm in SAGA GIS, such as Gaussian Filter, and Watershed Segmentation. Then simply count the number of segmented table records with height greater than a value.

The example here counts the trees using the following general steps:


  1. Load the DSM and DTM datasets
  2. Calculate the canopy heights
  3. Smooth the canopy heights
  4. Segment the canopy heights
  5. Count the number of segments with canopy heights above a certain value
Load the source datasets
  1. Start SAGA GIS.
  2. Load and display the digital surface model (DSM) grid file, e.g. C:\data\dsm.asc.



  3. Load and display the digital terrain model (DTM) grid file, e.g. C:\data\dtm.asc.

Calculate the canopy heights
  1. Select Modules | Grid | Calculus | Grid Difference.

    The Grid Difference dialog box appears.
  2. In the Grid system field, choose the system of the source datasets, e.g. 683x 683y; 312480x 51952717y.
  3. In the A field, choose the digital surface model grid, e.g. dsm.
  4. In the B field, choose the digital terrain model grid, e.g. dtm.
  5. Click Okay.

    The canopy height model grid is created. The default name is Difference(A-B).
Smooth the canopy heights
  1. Select Modules | Grid | Filter | Gaussian Filter.

    The Gaussian Filter dialog box appears.
  2. In the Grid system field, choose the system of the source grids e.g.  683x 683y; 312480x 51952717y.
  3. In the Grid field, choose the canopy height grid, e.g. Difference (A-B).
  4. In the output Filtered Grid field, choose Create.
  5. In the Search Radius field, choose a value to approximate the tree radius e.g. 5.
  6. Click Okay.

    The output smoothed grid is created. Default name is Difference (A-B) [Gaussian Filter].
Segment the smoothed canopy height model
  1. Select Modules | Imagery | Segmentation | Watershed Segmentation.

    The Watershed Segmentation dialog box appears.
  2. In the Grid system field, choose the source grid system e.g.  683x 683y; 312480x 51952717y.
  3. In the Grid field, choose the smooth canopy height grid e.g. Difference (A-B) [Gaussian Filter].
  4. In the Output field, choose Seed Value.

    Note: since the segmentation will be run on the source grid of canopy height values, the resultant seed values will be the estimated heights of the tree tops.
  5. Ensure the Method is set to Maxima.

    Note: if set to Maxima, the watershed segmentation algorithm will start from the top (max) of the tree and flow down.
  6. Optional. Toggle on Borders.
  7. Click Okay.

    The segmented canopy height grid "Difference (A-B) [Gaussian Filter][Segments]" is created. 

    The canopy height point layer "Difference (A-B)[Gaussian Filter][Seed]" is created also.
Count the number of segments above a certain canopy height
  1. In the Data tree pane, right click on the newly created point layer node under the tree hierarchy - Shapes | Point | 01. Difference (A-B) [Gaussian Filter][Seed].

    A pop up menu appears.
  2. Choose Attributes | Show.

    The attributes table is displayed.
  3. Right click on the VALUE header.

    A pop up menu appears.
  4. Choose Sort Fields.

    The Sort Table dialog box appears.
  5. In the Sort first by field, choose VALUE.
  6. In the Direction field, choose descending.
  7. Click Okay.

    The table is sorted.
  8. Scroll down the table to the rows with the VALUE greater or equal to 5.

    The row number on the left indicates the rough estimate of the number of trees greater than 5 meters.

    Note: instead of using SAGA GIS to do the counting with the tabular data, it may be easier to export out the point layer into a database software and perform the analysis there

1 comment:

giulio panizzoni said...

Thanks!!Great Tutorial!!

Related Posts with Thumbnails