Last Updated: 16 February 2023
Prepared by: Kevin McGarigal
Tutorial 2. Analyzing a Single Grid
In this tutorial, you will compute a suite of structural and functional patch, class and
landscape metrics for a single input grid.
1. Open FRAGSTATS
First, open FRAGSTATS from the
start menu or by double clicking on
the FRAGSTATS icon on the
desktop.
If FRAGSTATS does not open
contact the development team at
[Link] along with a
detailed description of your setup.
2. Create a New model
Next, you need to create a
FRAGSTATS "model" for a categorical landscape representing the patch mosaic model
of landscape structure. A FRAGSTATS model is simply a file containing a complete
parameterization of FRAGSTATS; i.e., everything needed to conduct an analysis. Click
on the New button on the tool bar or select New from the File drop-down menu. This
creates a blank model for you to parameterize.
1|Page
3. Import a grid
Next, import a grid to analyze. Specifically, you need to Add a layer to the batch
manager on the Input layers tab. Click on the Add layer button to open the import data
dialog.
Select GeoTIFF data type in the left pane and then navigate to the tutorial directory by
clicking on the [...] button and selecting the [Link] grid. Note, when you load a
2|Page
Geotiff, the grid attribute information pertaining to row count (y), column count (x), cell
size, and nodata value are read from the grid header itself, and thus these fields are
grayed out in the dialog. The only grid attribute item that you need worry about (and
can modify) is the background value.
By default, the background class value is set to 999, but you can change it here to any
class value that you want, so long as you understand the implications. Briefly,
background is a class used to distinguish cells that you essentially want to ignore in the
analysis; these can be cells that couldn't be classified to a real landcover class for lack of
data, or cells that you simply want to treat as part of the background matrix in the
landscape. Importantly, background cells can be considered 'internal' or 'inside' the
landscape of interest (if assigned positive values) and/or 'external' or 'outside' the
landscape of interest (if assigned negative values). Internal background is considered
part of the landscape of interest and contributes to the total landscape area, and thus
affects many metrics; external background is not considered to be part of the landscape
of interest and only contributes to edge adjacency information for cells along the
landscape boundary. To fully understand the implications of designating background, be
sure to read the help files on nodata, backgrounds, borders, and boundaries in the
section on User guidelines - Overview. Importantly, as a general rule, you should never
set the background value equal to the nodata value. If you set the background value
equal to the nodata value, and you have internal background, FRAGSTATS cannot
distinguish between them and all background (internal and external) and nodata will be
treated the same, as external background. For now, keep the background value set to
999.
If you are using ascii or binary files, you can select the corresponding data type in the
left pane and then navigate to the tutorial directory by clicking on the [...] button and
3|Page
selecting the corresponding grid. For example, to use the provided ascii grid, select
[Link]. Note, when you try to load an ascii grid or binary grid, the grid attribute
information must be entered manually. If you don't enter this information before
selecting the grid, the software will complain that the layer attributes are invalid, so be
sure to enter valid numbers for each of the attributes after selecting the grid.
Specifically, for this grid, you need to enter row count (y) = 102, column count (x) =
102, cell size = 50, and nodata value = 9999. As before, you can also edit the
background class value, but for now, keep the default value of 999.
4. Optionally, input a class descriptors table
Next, you have the option of inputting a class descriptors table. The class descriptors
table allows you to specify a character description (i.e., patch type) for each numeric
class value, specify whether to compute statistics for each class, and whether to
designate each class as background. The class descriptors table is optional. If you do not
provide this table, then the numeric class values are used in the output, all classes are
enabled and none are treated as background except any class with the assigned
background value (999 in this case).
Open up the provided [Link] file in a text editor. Note, FRAGSTATS
recognizes *.fcd as the extension for class descriptor files, but this is not a required
extension. This file contains four fields. ID
refers to the numeric class values; these are
the unique cell values in the grid. These
values derive from your landscape
definition. Name is simply a description of
each class and this will be output as TYPE in
the FRAGSTATS output files. Enabled is a
logical (true or false) and indicates whether
to compute and output statistics for the corresponding class. Lastly, IsBackground is
4|Page
logical (true or false) and indicates whether to treat each class as background or not.
Note, a "true" involves reclassifying the corresponding class to the background value
specified earlier (999 in this case). If we had specified say, 400, as the background value
earlier, then Water would be treated as background regardless of what is designated in
this table.
To use the provided class descriptors file, click on the Class descriptors Browse
button in the Common tables section of the user interface on the Input layers tab and
navigate to the tutorial directory and select the [Link] file.
5. Specify additional parameters for the analysis
Next, you need to specify some additional parameters for the analysis. Click on the
Analysis parameters tab on the left pane of the user interface. Here, is where you
chose the neighbor rule for delineating patches (4 cell rule or 8 cell rule) and specify
whether you want to sample the landscape to analyze sub-landscapes using one of the
alternative sampling schemes (see tutorial #6).
For this tutorial, keep the default 8 cell neighbor rule and the No sampling strategy;
the exhaustive moving window sampling strategy is covered in tutorial #4 and the rest
of the sampling strategies in tutorial #6. In addition, check the boxes for Patch, Class
5|Page
and Landscape metrics under the No sampling option. Note, you must have at least
one of these boxes checked or you will get an error message later when trying to run the
model. However, only check the level corresponding to the metrics you want to
compute. Some applications will involve patch level metrics, for example when
evaluating the spatial character and context of each habitat patch in a metapopulation
context. Other applications will involve only the class level metrics, for example when
evaluating the fragmentation of a focal class. And still other applications will involve
only the landscape level metrics, for example when evaluating overall landscape
heterogeneity. Of course, some applications will involve more than one level of metric.
There is an optional check box for generating a patch ID file. If checked, FRAGSTATS
will generate a patch ID grid in the same format as the input layer, and each cell will be
assigned a unique patch ID value. Thus, all the cells belonging to patch #1 will be
assigned the value 1, all cells in patch #2 will be assigned the value 2, and so on. The
unique patch ID values will correspond to the unique patch ID values in the PID field of
the [Link] output file. In this manner, the patch ID file can be used to connect
the patch metric results to the corresponding patch in the landscape. In fact, the
[Link] outfile can be joined to the patch ID grid in the GIS if so desired, but we
will not illustrate this here.
6. Select metrics
Next, you need to select some metrics to compute. Give that you selected patch, class
and landscape metrics in step 5, you need to select individual metrics at each of these
levels.
To begin, select Patch metrics in the top right pane of the user interface. Click on the
Patch metrics button and then on each tabbed set of metrics. You can choose a subset
of metrics or simply "Select all" -- your choice. Note, on the Aggregation tab, if you
select either the Proximity index or the Similarity index, then you also need to specify a
Search radius. These metrics are "functional" metrics and thus require additional
parameterization. Both of these metrics require a search radius; the Similarity index
also requires a similarity weights table (see below). To specify a search radius, click on
the [...] button and enter the desired search radius in meters; e.g., 500.
Next, click on the Class metrics button and then on each tabbed set of metrics. Again,
you can choose a subset of metrics or simply "Select all" -- your choice. Note, on the
Area-Edge tab, if you select Total Edge or Edge Density, then you need to consider
how you want to treat any background or boundary edge in the edge calculations. The
default is to not consider any of it as true edge. However, you can choose to treat all of it
as edge or any specified proportion as edge. To change the default, click on the [...]
button and enter your choice. Note, since the input landscape contains a border and
does not contain any designated background, the issue is mute since we know the true
6|Page
status of every edge segment along the landscape boundary and there are no
background edges to worry about. Similarly, on the Aggregation tab, if you select the
Connectance index, then you also need to specify a threshold distance within which
patches are deemed "connected". Simply click on the [...] button and enter the desired
threshold distance in meters; e.g., 500.
Lastly, click on the Landscape metrics button and then on each tabbed set of metrics.
Again, you can choose a subset of metrics or simply "Select all" -- your choice. Note, on
the Diversity tab, if you select Relative Patch Richness, then you also need to specify
the maximum number of classes (or patch types). Simply click on the [...] button and
enter the value; 6 in this case.
7. Conditionally, input additional common tables
Next, if you selected any of the Core area metrics, Contrast metrics or Similarity index
(on the Aggregation tab) at any level (patch, class or landscape), then you also need to
create and input additional ancillary tables in order to parameterize these metrics. If
you fail to input these tables or try to input improperly formatted tables, you will get an
error message and the analysis will fail. Importantly, it is up to you to create these
ancillary files to ensure that they are meaningful to your application. There are no
meaningful default values for these tables; creating these tables is how you functionalize
the corresponding metrics for your particular application.
Open up the provided [Link] file in a text editor. Note, FRAGSTATS
recognizes *.fsq as the extension for these common ancillary tables, but this is not a
required extension. This comma-delimited ascii file contains the depth-of-edge effect
distances (in meters) for each pairwise combination of classes (or patch types). The file
must begin with the line: FSQ_TABLE. It can contain any number of comment lines
beginning with the character symbol #. It must contain a class list of literal names (i.e.,
class descriptors) or numeric class values corresponding exactly to those in the class
descriptors file. Note, only one of these lists is required and if both are provided, as in
the example below, only the first one encountered is used. Note, the list should include a
item for every class in the input grid. If the list contains additional classes not found in
the input grid, they are simply ignored. Similarly, if the list omits a class found in the
input grid, the edge depths are assumed to be zero by default.
The class list is followed by the edge depths for each pairwise combination of classes,
given in the order they are provided in the list, and is read as follows. The row indicates
the focal class and the column indicates the adjacent class. Thus, the fourth row is for
Forest (fourth in the list) as the focal class, and each of the entries represents the depth-
of-edge effect distance penetrating into Forest from an adjacent class. For example, in
the table below, Open has an edge effect that penetrates 100 m into Forest, Resident
7|Page
penetrates 50 m into Forest, and so on. Note, in this example, edge effects are specified
only for the Forest class.
To use the provided edgedepth file, click on the Edge depth Browse button in the
Common tables section of the user interface on the Input layers tab and navigate to the
tutorial directory and select the [Link] file.
Repeat the process above for the provided [Link] and [Link] tables;
these tables provide the edge contrast weights and similarity coefficients for each
pairwise combination of classes (patch types), respectively.
8. Optionally, save the model
Next, you might want to save the model for future use. Often times it is easier to open a
saved model and modify it than to create a new model from scratch. At any point in the
process of parameterizing the model, simply click on the Save or Save as buttons on
the toolbar or select these options from the File drop-down menu to save the model.
Simply navigate to the desired directory and enter a file name for the model. Note,
FRAGSTATS will automatically assign the extension *.fca to the file, which identifies the
file as a model for a categorical landscape.
9. Run the model
Next, you are ready to run the model. Simply click on the Run button on the toolbar or
select this option from the Analysis drop-down menu. This will open the Run dialog that
lists the analysis type (no sampling in this case), the current file (which gets listed after
clicking on the Proceed button, below), and the number of metrics selected at each level
(patch, class and landscape). If you like what you see, click on the Proceed button,
otherwise click on Cancel and make the needed modifications to the model. In the
8|Page
example shown here, the run includes 75 patch metrics, 109 class metrics and 116
landscape metrics because I selected All the available metrics at each level.
10. Browse the results
Pay attention to the Activity log in the bottom right pane of the user interface. If all went
well, you will learn that the run ended and how long it took. Assuming that the run was
successful, you are now ready to browse the results. Click on the Results button in the
top-right pane of the user interface and then on each tabbed set of results. The results
are displayed in a table for each level of metrics selected. So, if you computed patch,
class and landscape metrics, as was done here, there will be results in each of the
corresponding tabs. Otherwise, only the tab corresponding to the level of metrics
computed will contain data; the others will be empty. The Patch tab will contain a row
for each patch in the input landscape and a column for each patch metric selected. The
Class tab will contain a row for each (non-background) class in the input landscape and
a column for each class metric selected. The Landscape tab will contain a single row
for the entire input landscape mosaic and a column for each landscape metric selected.
9|Page
Once you have verified that the tables contain results, the next step is probably to export
the tables so that you can use them in subsequent analyses. To export the results, simply
click on the desired run in the Run list (note, at this point you should have only one run
listed), and then click on Save run as... and navigate to the desired folder and enter a
basename for the output files. The basename will be given an extension corresponding
to each level of metrics computed ([Link], [Link], and
[Link]). Thus, in this example, three files will be created corresponding to the
three levels of metrics computed. Note, a fourth output file containing the cell adjacency
information can be created by checking the Save ADJ file check box ([Link]).
Each of these output files is a comma-delimited ascii file and can easily imported into
other software such as R and Excel for further analysis and summary.
Note that is also possible to automatically save the results with the execution by
checking the Automatically save results option on the Analysis parameters tab in
the left pane of the user interface. Simply check this box and then click on the Browse
button to navigate to a desired output directory and enter a basename for the output
file(s).
10 | P a g e