Model for sumarizing polygon stats near a facility

778
12
01-23-2011 08:10 PM
MōnoSimeone
Occasional Contributor II
Hi -

I'm new to modelbuilder and wondering how to build a model that will:

a. take an input a layer of points
b. for each point in layer, select by location or buffer 1 mile
c. select polygons with centroid in buffer
d. create summary table of specific fields from those selected polygons
e. calculate the facility ID
f. join summary table back to the point feature.

1) Not sure if my model structure makes sense
2) I can't figure out how to capture the Facility ID so the summary table can be joined back.

Are there any good examples out there? Is someone willing to share a model?

I know conceptually it can be done but I'm so lost in understanding how to setup the parameters and have the model do one facility at a time. Any articles, guides, or anything would be appreciated.

Thanks,
m.
0 Kudos
12 Replies
DuncanHornby
MVP Notable Contributor
Mono,

You do not say which version of ArcGIS you are using. You need to tell us this so we can help you.

If you are using ArcGIS 10 then there is the new and very useful Feature Selection iterator, this will help with you model logic. Information about this can be found here.

Duncan
0 Kudos
MōnoSimeone
Occasional Contributor II
Doh! ArcGIS 10 - ArcInfo

Thanks Duncan, I read up on these "iterators". I kind of understand from the example what the Feature Selection iterator is doing. However, are the facilities the input or the buffer? The Facilities right? And Ill have to create the buffer as a second model and use that as the precondition to the Feature Selection?

Besides, I still don't understand how the FAC ID will be added to the summary table to enable a join back to the Facility features. I'm not sure it helps but I decided to make the Buffer Dissolve type = List and expose the Dissolve field parameter which I can pass on the FAC ID to the buffer layer input.

I assume, the output summary table will include the Feature Selection Group value for each row. Yes? If so, then using the FAC ID as the group from the buffer layer will be in the output summary table which will become a precondition to the join of the original facilities layer and the output. Yes?

And do I need to do anything with the Feature Selection Value?

I've attached my latest attempt.

Cheers,
m.
0 Kudos
DuncanHornby
MVP Notable Contributor
Mono,

I'm not understanding your logic.  Are you saying you have a point layer (the facilities) then for each point you want to create a 1Km buffer then use that buffer to select polygons that have their centroids in the buffer? If so then the model needs rearranging.

Start with the iterator, it's input is the point layer. This iterator then cycles through all the points 1 at time. That individual point feeds into a buffer tool the output being a single buffer, this then feeds into your select by location tool and the selected polygons feed into your summary tool.

Duncan
0 Kudos
MōnoSimeone
Occasional Contributor II
Hi Duncan -

Hm, so an iterator will go through the entire model for each feature of the input layer? OK, two things:

1) I think what I'm truly not understanding is how the FAC ID will be included as a field in the Summary table - this is what was driving my logic previously. Without the FAC ID I won't be able to join the summary table back to Facility layer. Is there some type of iteration field passed on by the tool that could be used as a join field?

2) Should I be expecting a summary table for each Facility point? Or one Summary table with each row being an iteration of the input facility?

Attached is an update based on your directions.

Cheers,
m.
0 Kudos
DuncanHornby
MVP Notable Contributor
You are almost there.

The iterator creates an output variable in your model called value, you would have set that to your ID. You can use that in an inline substitution. Read help if you don't know what that is.

Anyway I would then do:


  1. Add an ID field to summary table

  2. Use calculate to pass point id to this new field using inline substitution

  3. Append summary table to an existing empty table with exact same schema (same fields)


Let the model run then join table to original point layer, et voia!
0 Kudos
MōnoSimeone
Occasional Contributor II
I know! I can feel how close it is.

So, I ran the model before reading your post and the changes I used were:

1. in the Feature Selection I added the FAC ID as a group
2. Added the %Value% to the output summary table

When I ran the model it output a .dbf for each facility. I was expecting one table with all the values. I see what you mean with the Append, but it requires the user to input a predefined table. Instead, collect values. Et voila!

Many thanks. I might publish this and will include you in the credits if you like.
Cheers,
m.
0 Kudos
MōnoSimeone
Occasional Contributor II
Hey Duncan -

I have one more issue. I'm not sure how to setup the model so it can be used on different workstations with different output paths. I keep receiving the 000735 error and can't seem to get past it. I've tried modifying the output tables directory; clicking the managed setting...any suggestions?

Thanks,
m.
0 Kudos
DuncanHornby
MVP Notable Contributor
Mono,

According to the Help file the 00735 error means you don't have all the parameters set for a tool to run. You could try to validate your model (set any parameters first) and see where it goes white and then drill down to the problem?

Duncan
0 Kudos
MōnoSimeone
Occasional Contributor II
Yeah, I been playing around and got it almost back to working. Now the Add Field is throwing a generic error with the message the field is not nullable - no idea why.

Also, do I need to set a Workspace for models? How do I ensure the model will run in different environments?

Thanks,
m.
0 Kudos