ModelBuilder iterations through shapefiles

915
2
03-16-2012 05:24 AM
MelanieShapiera
New Contributor
Hi all

I have some home range estimates for fish that I made using the adehabitat pkg in R. However, a lot of them overlap land, so I need to subtract the area where they overlap with land ("BaseMap") from the total area to get the "water" estimate. I tried with one file, and I think if I use the intersect tool, then the calculate area tool, I can get the area of intersection(overlap), and eventually subtract that from the total values I got from R. The problem is, I have a bunch of fish, and want to automate the process, or else I'll be stuck clicking my life away.

I've tried to build a model using the iterate feature classes option in ModelBuilder, but I don't think it's actually iterating. Plus, I get an error for Calculate areas: "000641 : Too few records for analysis. This tool requires at least <value> feature(s) to compute results", which I don't understand because I've run it with only feature and it works fine. I'll attach my model attempt here. My goal was to calculate the total area of my KUD shapefiles, and then the area of intersection with the basemap, which I will eventually subtract. Any advice would be greatly appreciated.


Melanie
Tags (2)
0 Kudos
2 Replies
DennisJarrard
Esri Contributor
You have two "calculate areas" tools in the model. Which one is hitting the error? Also, could you upload the the model and the referenced data?
0 Kudos
MelanieShapiera
New Contributor
I removed the lower portion of the model and tried running just the Intersect>Calculate Areas part, and am getting this error.
The referenced data is a collection of many shapefiles (>400), so it is difficult for me to upload. I was looking further into this, and I think I have realised why the error is happening.
Some of my shapefiles do not intersect the basemap, so the intersect layer is essentially empty, and Calculate areas cannot run. This occured for the first file in the list, which is perhaps why the model isn't reiterating (though I am still uncertain about that). Is there any way I can add an "if" statement in Modelbuilder? Ex if %Name%Intersect>0 (or contains >0 features?), then calculate area etc.?

I have no experience with python scripting...

Melanie
0 Kudos