Select to view content in your preferred language

Fragstats: Error message when running metrics

6898
2
05-09-2013 06:34 AM
MeganLafferty
New Contributor
When trying to run Fragstats metrics (in Fragstats 4) on my ESRI Grid raster, I received the following error message:

Error: Unexpected error encountered: [Grid IO error encountered while loading: (my data)]. Model execution halted.

After reading though previous threads, I tried converting to an ERDAS Imagine grid (.img) file and importing that way, however when I tried to run metrics I received this error message:

Error: Unexpected error encountered: [vector<T> too long]. Model execution halted.

I have also tried converting to a GeoTIFF grid (.tif) and an ESRI header labelled grid (.bil) before adding the raster layer, but for these I also receive the [vector<T> too long] error message.

I have tried running metrics on data from a previous project and those have worked fine, so I know that Fragstats is running properly and ArcGRID is enabled.

Any help that you could provide would be greatly appreciated!
0 Kudos
2 Replies
JeffreyEvans
Frequent Contributor
I doubt that this is the problem but Fragstats only supports certain bit depths (8, 16 and 32 bit). Try exporting you data to an image format with a specific bit depth. You can do this in ArcCatalog by right clicking on the raster and in the context menu selecting Export > Raster to Different Format. There is a dropdown menu that allows you to specify bit type. I would keep it as an "img" format raster. When you add your raster to Fragstats select the "GDAL ERDAS Imagine grid" option.    

I know that they have been having considerable problems with ArcGIS compatibility and the GridIO library. I would recommend running the diagnostic tool available on the download page and then contacting the developers at mcgarigalk@eco.umass.edu

You could also revert versions. The underlying models are exactly the same just some coding overhead has been optimized and everything wrapped in a new GUI. There is also the addition of GDAL as the data engine, which is intended to avoid problems just like this. None of this is necessary to run a valid model.      

Fragstats download page
http://www.umass.edu/landeco/research/fragstats/downloads/fragstats_downloads.html
0 Kudos
MeganLafferty
New Contributor
Thank you Jeffrey!

From your help I was able to figure out what was going on.  This was my first time using Fragstats 4, so I was not familiar with the error messages.  When I went back to Fragstats 3.4 and tried uploading the raster, I received the message "Cannot load file (Cannot allocate memory)" which I recognized as my data being too large in size.  Once I decreased the cell size of my raster, I could successfully load it in Fragstats 3.4 and when I tried again in Fragstats 4 I could run metrics successfully both with the newly generated ESRIGrid and ERDAS Imagine Grid.

So, Unexpected error encountered:[vector<T> too long] can mean that the data file is to large to be processed in Fragstats 4.

Cheers,
Megan
0 Kudos