Link to FRAGSTATS Home Page
Link to FRAGSTATS Downloads
Link to FRAGSTATS Frequently Asked Questions Page
Links to Websites with Landscape Pattern Analysis Software
Link to FRAGSTATS workshops home page
 

FRAGSTATS: Spatial Pattern Analysis Program for Categorical Maps

Frequently Asked Questions

 
Quicklinks

This page contains answers to frequently asked questions.

  1. Are there any limits to class ID values?
  2. How do I cite FRAGSTATS for publication?
  3. How do I install FRAGSTATS for use with ESRI Grids?
  4. Why is FRAGSTATS unable to allocate sufficient memory?
  5. How do I determine if FRAGSTATS is still running?
  6. What does the error message "bad parameters internally passed" mean?
  7. Why can't I load my IDRISI images?
  8. Problems running under ESRI ArcGIS?
  9. What does the following error mean: "Unexpected error encountered: [bad allocation]. Model execution halted.", or "Unexpected error encountered while loading ..."
  10. What does the following error mean: ""Cannot_set_access_window"
  11. FRAGSTATS saves the header information but not the metric results to the output files
Q1. Are there any limits to class ID values (i.e., the unique integer value assigned to each distinct class or patch type)?
All classes must have non-zero integer values; that is, zero should not be used as a class value because it is impossible to assign a negative value to zerio to distinguish cells of that class that are outside the landscape boundary. Otherwise, there are no limits to the class values that can be used, although it is logical to use the smallest numbers possible.
Q2. How do I cite FRAGSTATS for publication?

Unfortunately, we can't provide a proper journal or book citation for the current version of FRAGSTATS. Currently, this website is the sole means of "publication" of the software. We suggest the following citation:

Version 4:

McGarigal, K., SA Cushman, and E Ene. 2012. FRAGSTATS v4: Spatial Pattern Analysis Program for Categorical and Continuous Maps. Computer software program produced by the authors at the University of Massachusetts, Amherst. Available at the following web site: http://www.umass.edu/landeco/research/fragstats/fragstats.html

Version 3:

McGarigal, K., S. A. Cushman, M. C. Neel, and E. Ene. 2002. FRAGSTATS: Spatial Pattern Analysis Program for Categorical Maps. Computer software program produced by the authors at the University of Massachusetts, Amherst. Available at the following web site: http://www.umass.edu/landeco/research/fragstats/fragstats.html

Q3. How do I install FRAGSTATS for use with ESRI Grids?

As noted in the user guidelines under data formats and in the installation instructions on the downloads page, if you wish to use FRAGSTATS with ESRI Grids (version 10.0 or earlier), you must have a system PATH variable in your environmental settings (Windows NT, 2000, XP, 7) that points to a necessary dll file that comes with Spatial Analyst license. This file is typically found in the Bin32 folder (ArcView) or Bin folder (ArcGIS). This allows you to install and run fragstats from any directory on your hard disk. Alternatively, you can run FRAGSTATS from the Bin32 or Bin folder. Detailed instructions are provided in the Help documentation (User Guidelines--Overview--Data Formats) and on the downloads page.

Q4. Why is FRAGSTATS unable to allocate sufficient memory?
FRAGSTATS in its current implementation is a 32-bit application and as such it has the 3GB hard ceiling on how much memory it can use. When running FRAGSTATS, if you see the memory allocation going all the way to 3GB or close then that it is reaching the maximum memory available, which may not be enough for very large and complex landscape. FRAGSTATS is a compute-intensive program; its performance is dependent on both processor speed and computer memory (RAM). Ultimately, the ability to process an image is dependent on the availability of sufficient memory (as noted above); the speed of processing that image is dependent on processor speed. Of particular note is the memory constraint. FRAGSTATS loads the input grid into memory and then computes all requested calculations. Thus, you must have sufficient memory to load the grid and then enough leftover for processing and other operating system needs, and stay within the 3GB limit. Memory requirements are affected by grid size, number of patches and number of classes. Of partiuclar importance is the number of patches, which can vary by orders of magnitude from one application to another. To determine whether you have enough memory based solely on grid size, you can use the following formula: #cells*4bytes. Thus, if you have a 256 rows by 256 columns grid, the minimum memory needed is 256 kb (256*256*4/1024 bytes/kb) just to load the grid. However, you also need additional memory that increases with the number of patches and classes, and this can be extremely constraining when working with complex (patchy) images. The solution to this problem if it arises is to work with as much memory as possible up to 3GB, simplify the grids, reduce grid size (e.g., resampling), subdivide the grids into separate sections, etc. A long-term solution is in the works (e.g., port to 64-bit) that should reduce or even eliminate memory constraints. In the meantime, you will have to work around the memory constraints. Note, the memory requirement is especially constraining in the moving window analysis because FRAGSTATS requires enough memory for the input grid plus one output grid, plus enough leftover for other processing needs and system needs. If the moving window analysis is selected, FRAGSTATS checks to see if it can allocate enough memory for three grids (i.e., 1 input grid + 1 output grid + enough leftover to insure performance). In the above example, you would need at least 768 kb of memory to conduct a moving window analysis at a minimum based on grid size, but an unknown amount of additional memory depending on numbers of patches and classes.
Q5. How do I determine if FRAGSTATS is still running?
During a long FRAGSTATS run (e.g., a batch file), it may be unclear whether FRAGSTATS is actually running or not. The "running" dialog box that was open when you submitted a run should remain open and should indicate that it is analyzing a landscape. However, if for any reason you are unsure of the status, the surest way to confirm that FRAGSTATS is actually running is to open the Windows Task Manager. The Applications window should indicate whether FRAGSTATS is "running" and the Processes window should indicate whether FRAGSTATS is using CPU and memory. If it is, then your O.K.; let it continue running. Remember, some runs can take a very long time -- hours, days and possibly even weeks.
Q6. What does the error message "bad parameters internally passed" mean?
Unfortuntately, this error message is generated in 12 source files for several reasons. The most common reason is an empty (or missing) input or output filename, but also zero rows or zero columns in the input dataset, or no metric selected at any level. In the absence of any additional info (input file type and name, metric selection, extra messages prior or following the one in question...) it is impossible to tell what exactly went wrong. If you get this error message after checking and correcting the above mentioned problems, then please send a detailed message with all relevant information to Kevin McGarigal.
Q7. Why can't I load my IDRISI images?
Unfortunately, version 4.2 of FRAGSTATS has not kept pace with changes in the file data formats with IDRISI software since the original release. Consequently, FRAGSTATS (4.2) does not include an input option for IDRISI. As an alternative, you may want to use the tool LANDISVIEW to convert your IDRISI files into ASCII grids for compatibility with FRAGSTATS.
Q8. Problems running under ArcGIS?

Several users have reported problems trying to run Fragstats under ArcGIS10.x, when it ran fine under ealier versions. The problem is ESRI, who consistently screws all third party programs with every upgrade. Apparently, they think the world revolves around them and give no consideration to campatibility with other programs. Version 3.4 was a stop-gap release that worked with ArcGIS10.0 (see downloads). However, version 4.2should be compatible with all versions of ArcGIS 10.0 and earlier and is the current development version of the software. If you are having problems getting FRAGSTATS to open, then run the diagnostic utility available from the downloads page. This will verify that you have a valid Spatial Analyst licence.

The most commonly report problems getting FRAGSTATS to run under ArcGIS (version 10.0 or earlier) are as follows:

  • As described with the download instructions and in the help files under "data formats", for FRAGSTATS to run under ArcGIS (version 10.0 or earlier), you must have a valid license that includes Spatial Analyst.
  • Also, to run FRAGSTATS from any directory, you must edit your system's environmental PATH variable to include the directory containing the required .dll file (see instructions on the download page and in the help files).
  • Moreover, the PATH containing the required .dll file must be the FIRST path listed in your system's PATH variable that contains ArcGIS; note, it is common with some users to have more than one path to an ArcGIS folder listed in the system's PATH variable and users often add the path to the required Bin folder last to the list.
  • Lastly, the path to the input grids cannot contain spaces; note, this refers to the input grids for a FRAGSTATS analysis, not the installation directory containing the .dll file refered to above.

Unfortunately, thanks to ESRI, FRAGSTATS currently does not work with ArcGIS versions 10.1 or later. Until we modify FRAGSTATS again to accommodate the upgrade, here is a solution presented by Sue Clark, in her words:

"I changed my tool to extract to a .img file and it works great.  I had to project my mask files and grids to a projection that used meters as linear units.

Below is my routine for extracting grids.

    #

    #    extractBufRings

    #    Extract grids using a polygon mask

    #    Inputs:

    #       vegGrid - vegetation grid

    #       ext - string containing the extent

    #       outRast - name of the output grid (.img)

    #       mask - the grid mask

    #

    def extractBufRings(vegGrid, ext, outRast, mask):

        # Define a layer file for the small grid made with the buffer ring extent

        vegLayer = 'vegLayer.lyr'

        # Get the vegetation for the area of interest via MakeRasterLayer

        arcpy.MakeRasterLayer_management(vegGrid, vegLayer, "", ext, "")

        # Extract the vegetation layer to the output raster

        arcpy.gp.ExtractByMask_sa(vegLayer, mask, outRast)

Here is the call to that routine.

                    outRast = gridList[g][1] + outRastName + '.img'

                    extractBufRings(gridList[g][0], extent, outRast, curMaskLyr)

Of course the code has some variables that are specific to my application and I’m still using the gp version of the extract by mask tool."

Q9. What does the following error mean: "Error: Unexpected error encountered: [bad allocation]. Model execution halted." or "Unexpected error encountered while loading ..."

In FRAGSTATS 4 this error is reported in a variety of situations:

1) When enough memory cannot be allocated to either load the grid or complete the processing. This happens when the grid is too large given other factors. The solution is either to increase your memory to >2GB or, if this fails, subdivide the landscape into sub-landscapes.

2) When the grid cells are not absolutely square (for ESRI ArcGrids). As described in the help files (see Data Formats), with the exception of ESRI ArcGrids (see below), FRAGSTATS accepts cells that exhibit differences between height and width less than 0.1%. This means that cells need to be approximately square, usually out to several decimal places. With respect to ESRI ArcGrids, FRAGSTATS cannot accept anything but perfectly square cells. This is a hidden problem with ESRI ArcGrids in some cases. Although the grid description will say the cells are square, this can be an artifact of the rounding done for displaying purposes. Sometimes the non-square problem is beyond the first 14 decimal places, and ESRI does not allow you (us) to see more precision, even though it exist internally. The problem is that the error happens inside a FRAGSTATS call of an ESRI function, and there is nothing we can do except catch the exception and log it. Unfortunately, re-sampling the grid with the same cell size does solve the problem. However, re-sampling the grid with a different cell size does solve the problem. Note, the functions we are using from their library are those that were published and partially documented 10 years ago, because these are the only functions they will allow third party access to. In the meantime they have added many more functions that ArcGIS uses but nobody else can access. There is simply no ESRI documentation for handling situations like the one we're facing now. Thanks alot ESRI. The workaround here is to either re-sample the grid with a sufficiently different cell size to get a clean square cell or go the convoluted way of converting to ASCII and then back to ArcGrid.

3) When the grid cell size is not specified in meters and/or cell size <0.001. As described in the help files (see Data Formats), the grids must consist of perfectly square cells with cell size specified in meters and cell size >0.001. For certain input formats (ASCII and BINARY), this is not an issue because cells are assumed to be square and you are required to enter the cell size (in meters) in the graphical user interface, but for all others this information is included in the image header and must be defined correctly.

Q10. What does the following error mean: ""Cannot_set_access_window"
In FRAGSTATS 4 this error is reported when the path to input ArcGid contains spaces. The complete path to the folder containing the input grid cannot contain spaces. This only applies to ESRI ArcGrids.
Q11. FRAGSTATS saves the header information but not the metric results to the output files
In FRAGSTATS 4, if the path or directory to the input grid(s) contains Greek letters, or anything but English letters and/or numbers, the program will run successfully and report results to the results window, but it will only save the header information and not the metric results to the output files. The solution of course is not to include anything but English characters in the path name.

For more information, please contact:
Dr. Kevin McGarigal
Department of Environmental Conservation
University of Massachusetts
304 Holdsworth Natural Resources Center
Box 34210, Amherst, MA 01003
Fax: (413) 545-4358; Phone: (413) 577-0655
Email: mcgarigalk@eco.umass.edu

Copyright 2000 University of Massachusetts Amherst, Massachusetts, 01003. (413) 545-0111. This is an official page of the University of Massachusetts Amherst campus. All material in this website is made available according to the Fair Use Statute of the U.S. Copyright Act