0

Current state of the model

I am trying to create a unique watershed polygon for many different points and then running a function to merge all of the overlapping polygons into a single file. My model is successful at running one input point at a time but to save the outputs in the files I want, I have to manually change the names each time. I'm not sure how to automate the naming of these files.

I also don't know how to automate the process of loading in all of the different input points. I assume you would use an iterator but not sure which one and how to connect it to my model.

Regarding the merge tool, I would like to take each output from the raster to polygon tool and merge them into a single polygon file. This step isn't totally necessary because I can manually drag them all into the merge tool but if its not too difficult I would like to learn how to implement that as I am new to ModelBuilder.

This is 3 questions in one really.

1
  • 2
    Welcome to GIS SE. As a new user, please take the Tour, which emphasizes the importance of asking One question per Question. If you're asking three questions in one, you're more likely to have the question placed on hold until it is less broad.
    – Vince
    Jun 28, 2019 at 17:29

1 Answer 1

3

You should look into Inline variable substitution.. Also check out this page for iterator use. For example, with the following feature iterator, you'd input all of your point sets:

enter image description here

Let's say you are iterating through Point1, Point2, and Point3. If you name your output "Output_%Selected Features%", then your outputs will be called Output_Point1, Output_Point2, and Output_Point3. Alternatively, if you use %n%, it will track the number of iterations, and you'd get: Output_0, Output_1, and Output_2.

Overall: Whether or not you use the iterator, when you use the inline substitution for your input values, as long as your input values have different names, you won't need to manually change the output name every time. Just change the output names to something like "Output_%InputName%."

I use the following Arcpy script to merge all of the points in a GeoDataBase into one layer, if that helps:

#import the arcpy package
import arcpy

#set parameter for output
fpath = '/outpath/folder/result_name'

# specify the path to the GDB with the asset files
arcpy.env.workspace = '/your_GDB'
arcpy.env.overwriteOutput = True


# collects all the Feature Classes in the GDB
fcs = arcpy.ListFeatureClasses()

# run the Merge tool
arcpy.Merge_management (inputs=fcs, output=fpath)

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