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 would like to feed a list of feature classes (only one polygon per feature class, but up to 150 feature classes) into the Union tool in ModelBuilder by using a Feature Class Iterator and the Collect Values Tool. Unfortunately, it does not work since "Collect Values" only works with Merge, Append, etc.. Does anyone knows how to work around or another way to do this?

Thanks in advance!

Michaela

share|improve this question
add comment

1 Answer

You can do this by writing a python script that inserts a list of feature classes into the union tool.

To use this method:

  1. In Catalog create a toolbox
  2. Create a Script tool
  3. Make the input parameter Features Class that accepts multiple values
  4. Copy the code below to a text document
  5. Save the text document and change the extension from .txt to .py
  6. Reference the .py file within the Script tool
  7. Run the Script tool

    import arcpy
    
    myList = arcpy.GetParameterAsText(0).split(";")
    
    unionResult = "C:\\temp\\union.shp" # make sure you have this directory C:\\temp
    arcpy.Union_analysis(myList, unionResult, "ALL", "", "GAPS")
    

Hope that helps.

share|improve this answer
add comment

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.