Extracting and merging attribute data from Network Analyst in Modelbuilder

1787
2
Jump to solution
09-18-2012 04:48 AM
RossPudney
New Contributor II
Hi All,

I'm currently using Modelbuilder to build a series of processes which:


    Calculates individual service areas for approximately 11,500 point features across the UK

    Performs a spatial join to count the number of client locations within that specific service area

    Merges the outputs of those spatial joins together and extracts the attribute data into a .csv file
The model that I have built works fine, however I am having issues with optimising performance and am wondering if anyone has advice for me on how to improve the speed and cut out unecessary steps.

Specifically, I know my model is not optimised, as to get my final output I have to:

- Iterate through each feature point and create a service area which I then pull out the polygon features from using Select Data
- Perform the spatial join which generates a seperate polygon feature (I store this using the in_memory option)
- Collect the output of each Spatial Join output using Collect Values
- Merge the polygons together (into a local folder) and then extract the attribute data into a .csv using Extract Feature to Ascii.

My main issue is with the last process. Firstly I am unable to save this output using in_memory and I am not sure why this is the case, and secondly I am convinced that there must be a way in which I can avoid having to perform the Merge function to join all the results of each spatial join together in a .CSV table.

What I would like to know therefore is if there there a way to extract the attribute data from each spatial join and merge them into a table without having to go through the process of merging the spatial join polygons together?

Many thanks,

Ross
0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Frequent Contributor
Ross,

The model with the iterator and subsequent downstream processing should sit in a model which ends with your collects tool. That whole model is then a sub-model in another model which has your sub-model feeding into a merge tool. You'll need to expose your inputs/outputs as parameters so you can link the final collects from the sub-model into the merge tool.

I believe the image on this page is misleading as the merge would be executed on every cycle of the iteration tool, which is crazy! Although the dotted line seems to hint that it's a submodel but thats not what is displaying...

Duncan

View solution in original post

0 Kudos
2 Replies
DuncanHornby
MVP Frequent Contributor
Ross,

The model with the iterator and subsequent downstream processing should sit in a model which ends with your collects tool. That whole model is then a sub-model in another model which has your sub-model feeding into a merge tool. You'll need to expose your inputs/outputs as parameters so you can link the final collects from the sub-model into the merge tool.

I believe the image on this page is misleading as the merge would be executed on every cycle of the iteration tool, which is crazy! Although the dotted line seems to hint that it's a submodel but thats not what is displaying...

Duncan
0 Kudos
RossPudney
New Contributor II
Ross,

The model with the iterator and subsequent downstream processing should sit in a model which ends with your collects tool. That whole model is then a sub-model in another model which has your sub-model feeding into a merge tool. You'll need to expose your inputs/outputs as parameters so you can link the final collects from the sub-model into the merge tool.

I believe the image on this page is misleading as the merge would be executed on every cycle of the iteration tool, which is crazy! Although the dotted line seems to hint that it's a submodel but thats not what is displaying...

Duncan



Thanks Duncan, that did significantly speed up the process.

Just a tip for anyone replicating something similar - I was saving all my outputs to the in_memory workspace, and when I ran the sub model within a model, it was failing once it started the Merge function (ie: once the sub-model had complete). The reason this happened was that I had the outputs of the last function in the sub model (Table Select) as an Intermediate Layer before I used the Collect Events tool. This meant that when the sub-model completed - the intermediate data deleted all the files which the collect events function was calling. Unchecking the intermediate layer option off fixed this issue.