Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to develop a model in modelbuilder that will allow for a number of polygon shapefiles to be paired with each other. Say a group of 3 shapefiles (1,2,3) located in the same folder would be processed producing individual shapefiles 1-2, 1-3, 2-3. Is there a way to do this in modelbuilder? Thanks in advance

share|improve this question
    
Thanks for your help. I do want to do this over many feature classes and I dont think modelbuilder will work. Python I think is the way to go for this. @nmpeterson –  user6784 Apr 12 '12 at 23:06

3 Answers 3

Your problem is that Model Builder only allows for one iterator per model. For your use-case, you need two (like nested loops iterating your list of files in a program). You could try using an iterator as one input and setting the other input to a list/series but model builder doesn't always work the way you might expect. However this should be an easy task to code in ArcPy or the Python API for OGR.

share|improve this answer

The merge tool will do what you want. It could look something like below. Note that your field names need to be the same for all shapefiles in order for them to map correctly.

enter image description here

Hope this helps

share|improve this answer
    
I think his problem is that he doesn't necessarily know how many feature classes will be included, and that he wants to be able to essentially have this happen for every possible pair of shapefiles in a specified folder. That was how I understood the question, at least. –  nmpeterson Apr 6 '12 at 2:13

Two iterators nested in another model, which merges of joins the outputs of each of the iterators?

Or a nested iterator, with the 'inner' model and 'outer' model both iterating over the same list of data-sets. And then whatever tool is being used to 'pair' the two datasets in the outer model.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.