Select to view content in your preferred language

merging shapefiles in batch within parameterised model leads to crap

1625
0
03-02-2011 11:46 PM
PhilippeVan_De_Vreken1
Emerging Contributor
Hi folks!

I face a problem with the merge-tool within a parameterised model I built with the modelbuilder.
The problem is as follows: in the last step of my model I want to merge 2 point shapefiles. Both shapes are defined as model parameters and also the output of the merge is defined as a model parameter. I introduced those parameters as I want to run my model for 10 successive years where each newly created shapefile for each year gets a unique name (e.g. centroid_parcels09, centroid_parcels08, centroid_parcels07,...). I run the model in batch so that after adjusting all parameters for each year I can run the model in one time instead of 10 times running it.

The model works perfectly, except for the last step where the 2 point shapefiles are merged. Although the fields of those 2 shapes are identical, the output of the merge-tool is crap except for the first run (or year). Let's say we run it for 2 years: 2009 and 2008 (so a batch with two runs)
Centroid_parcels0x_weird_shape_total.shp (fields CC1, CD1, UC) + Centroid_parcels0x_minus_centroid outside polygon.shp (fields CC1, CD1, UC) --> Centroid_parcels0x_TOTAL.shp
For x = 9 (first run for year 2009) the output is as expected: Centroid_parcels09_TOTAL.shp with fields CC1, CD1, UC
However, for x = 8 (second run for year 2008) the output is not as expected: Centroid_parcels08_total.shp has the fields CC1, CD1, UC, CC1_1, CD1_1, UC_1. So the fields are "doubled". I really don't get the problem! Why does the second merge fails?
It even becomes more strange when I noticed that merging all newly created point shapefiles in batch for the 10 successive years in a second tool gives a good result.
Can anyone help me with this?

Thanks in advance,
Phil
0 Kudos
0 Replies