Select to view content in your preferred language

How Do I run many spatial join without overwrite previous results in Model Builder?

3078
4
04-09-2013 05:53 PM
Frederico_AugustoMartins_Valtu
Emerging Contributor
Hello,

I'm trying create a model in the "Model Builder" (arcGIS 9.3) to generate a presence/absence matrix of some species. My objective is generate a table with the species names in each column and the presence represented by "0" or presence represented by "1" in the lines (see the example bellow).

ID species 1  species 2  .....  species n
0       1             0                   0
1       0             0                   1
2       0             1                   1
3       1             0                   1
.        .             .                    .
.        .             .                    .
.        .             .                    .

Data base
I have many polygons with the species' distribution  and one grid like a fishnet delimiting the study area (polygon with many cells of same size).

I created a model (see the attached file) with "a list of values" in the species' parameter to perform the model to each species.
However the results countain all species with presence/absence values from the last species in the list of the spatial join tool. This "error" occur because first the model run all spatial join to only after do the others procedures. Then the field calculator calculate all species presence/absence based in the last species. [ATTACH=CONFIG]23362[/ATTACH]

Thanks!
0 Kudos
4 Replies
markdenil
Frequent Contributor
You need to Iterate in ModelBuilder.
This will allow you to cycle through each species and process that before moving on to the next.
There are several Iterate options, such as Iterate Datasets or Iterate Feature Classes.
0 Kudos
Frederico_AugustoMartins_Valtu
Emerging Contributor
You need to Iterate in ModelBuilder.
This will allow you to cycle through each species and process that before moving on to the next.
There are several Iterate options, such as Iterate Datasets or Iterate Feature Classes.


I used a list of values (polygon of species) to perform the iterate and I solved the problem of the overwriting output insering  the iteration value (%i%) in the name of the output generated by spatial join (i.e output%i%). Then I used the Join Field tool to construct the final matrix.

Thanks!!
0 Kudos
BarnabasDaru
New Contributor
I used a list of values (polygon of species) to perform the iterate and I solved the problem of the overwriting output insering  the iteration value (%i%) in the name of the output generated by spatial join (i.e output%i%). Then I used the Join Field tool to construct the final matrix.

Thanks!!


Hi FVFaleiro
I am also very interested in your approach. However, you said that you "created a model (see the attached file) with "a list of values" in the species' parameter to perform the model to each species."
However, I can't access the attachment. Could you please make the model available so that i can reproduce it?
I have a set of polygons and I am interested in creating a presence/absence matrix for the polygons using grid cells generated by fishnet.
Thanks and kind regards
Barnabas
0 Kudos
Frederico_AugustoMartins_Valtu
Emerging Contributor
Hi darunabas, see the png file attached in the first message, because I lost the model builder file.

Hi FVFaleiro
I am also very interested in your approach. However, you said that you "created a model (see the attached file) with "a list of values" in the species' parameter to perform the model to each species."
However, I can't access the attachment. Could you please make the model available so that i can reproduce it?
I have a set of polygons and I am interested in creating a presence/absence matrix for the polygons using grid cells generated by fishnet.
Thanks and kind regards
Barnabas
0 Kudos