Hello,
I am trying to create a model to automate the count of wells based upon a specific watershed boundary and then based upon that result the number of wells that meet different select by attribute queries.
I've been able to get the first part of the model to work where it picks the desired watershed (This is done by a Select by Attribute tool) then by a select by location tool it picks the wells that intersect with that watershed boundary. My issue comes into play when I try and do a Select by Attribute tool upon these selections with varying attributes. (I found I had to set the selection type to be Select subset from the current selection to get the selection within the desired watershed boundary and wells) It runs just fine for the first round but if I try and run it with more Select by attributes for the different types of wells I'm looking at, it just gives me the first selection. I've tried putting in a clear selection as one of the Select by Attributes but that still does not work. I know if I were to do this in python it'd be easier but I'm not very proficient in python, hence trying to figure it out in model builder first. If anyone can give me tips, I'd appreciate it.
Here is a picture of the Model.
I think the Summarize Within tool will get you the well count per watershed in one shot, among other aggregates. If that doesn't work for your needs, take a look at the Spatial Join tool, this will produce a new feature class with the watershed data attached to the intersecting well which you can process further.
The link to your model graphic does not work.
Thanks for letting me know. I updated the post with a picture of the model.
I believe the issue is that having selected the watershed and used that selection to select the points within it you do your first attribute selection, that immediate "destroys" the selection based upon the watershed polygon.
You have two options, start using an iterator and get your head around embedded sub-models, or the more clunky but easier to understand is for each attribute selection have a separate select by location before it. At the moment you have three select by attributes feeding from one select by location, you want to duplicate the location tool each with the select HUC tool feeding to them. With that logic after a select by attribute has run the selection on the wells is reset by the location tool.