0

I want to automate a task on ArcGIS, and I have created a function chain working well. The chain simply evaluates a point, calculates multiple hydrological rasters & values and gives output. I have 300+ points and I have to evaluate and save each one's layers results separately so I need a for loop in the start that counts the file & loops and outputs. Below you can find a Matlab - R-esque imaginary code flow what I need to do.

What I need as a code :

%% assume points.shp with 300 entities
N = count_entities(points.shp) %% Get N = 300
For i = 1:N
Point(i) = extract(points.shp(i))
Output(i) = model_function(Point(i))
End

I am aware of naming problems - I can solve with variable name nodes so no problem with that, my main lack-point of knowledge is establishing primary count and loop steps.

Can someone offer some step by step guidance creating this nodes?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Mar 1, 2022 at 7:43
4
  • 1
    You tag and talk about ModelBuilder, but mention writing Python code. Please confirm you are talking ONLY about ModelBuilder? Are you using ArcMap or ArcGIS Pro? Commented Mar 1, 2022 at 12:34
  • By "points" you mean point layer? You have 300 point layers, or one point layer with 300 features in it? Commented Mar 1, 2022 at 12:48
  • For KHibma's question, I prefer it ONLY about ModelBuilder since I don't know Python, but if I can only do this in Python, I would try to force it. I understand coding scheme of Python when I take a glance, I just didnt use it & learn it in the past. And I am using Arcmap. For BERA's question, I have a single point file with 300 entities. Commented Mar 1, 2022 at 13:23
  • Please use the edit button beneath your question to revise it with any requested clarifications. Commented Mar 1, 2022 at 21:00

1 Answer 1

1

Use the Iterate Feature Selection iterator:

Iterates over features in a feature class

So for each point the model is executed once and outputs a file.

answered Mar 1, 2022 at 14:26
0

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.