0

I am trying to iterate a series of feature classes (polygons) from two different/separated folders in model builder to convert a series of polygons using union and then the output for aggregate polygon tool. However, I am having an issue with the input file names. I have to match each entry with part of their names which are sharing a map#. In example both files are sharing map number like orange001 and apple001 or onion002 and banana002. I need help on matching the name of each file entry and reading it as input for my model to create a desire output. I used 2 models as subtype and type which I can use the subtype and read the 1st file from my first folder and then I have to match its name with 2nd entry and grab the shp file and continue my work.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Mar 7, 2016 at 14:37
2
  • 1
    Although ModuleBuilder has iterators, this operation becomes much more complex in ModuleBuilder than a standalone python script. Are you open to python/arcpy script answers? Commented Mar 7, 2016 at 17:33
  • Yes. quick question, Can I use conditions in model builder to evaluate the name from both entry and comparing both file or there is no way. If yes please let me know. Thx Commented Mar 7, 2016 at 20:40

1 Answer 1

2

Here are some general steps to do this via python/arcpy:

  1. Use my answer in this Q/A (see link below) for understanding how to find like name feature classes. For your case the logic will be slightly different since you will need to walk through two different directories. You will need to nest one walk statement/loop within the first walk statement/loop (one looking at the one dir and the other looking in the other dir).

Selecting features based on similar name

  1. After you have the two found layers assigned to different variables, insert those into the Union method (link has a arcpy code sample). Since this is geoprocessing tool, I would suggest to use in-memory workspace for the union layers
  2. Finally, reference the output union layer into the Aggregate method (link has a arcpy code sample)
answered Mar 7, 2016 at 21:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.