Finding overlap lengths between two polyline datasets through iteration

371
1
06-14-2010 09:07 AM
LanceJennings
New Contributor
Hello all,

I'm trying to build a model where the output will create a new table with a field which will be the overlap distance of the actual route and shortest path of each and every bicyclist in a dataset. The two datasets I'm working with are polylines created with the Network Analysis extension. One is the shortest paths (SHORTEST_PATH) of cyclists and the other is the actual routes (ACTUAL_ROUTE) of cyclists. There are about 1500 records on each dataset that has an ID field that connects the routes to the respodent.

The following explains what I do for a single process:
I select a feature in the ACTUAL_ROUTE layer and then I select another feature in the SHORTEST_PATH layer that has the matching ID with the first feature. I then intersect the two selected features which will extract a polyline feature where the two selected features overlap. I then use Hawths Tools to find the total length of the feature.

Some of the routes of cyclists overlap with other cyclist, so that is why I select features based on the ID's so I can segregate each cyclist's shortest path and actual route.

I can't figure out the iteration process in the model builder.
Basically I want the process to just go down a list (a field that contains the respondent's ID), select the two routes in different layers (shortest path and actual route) that contain that ID, intersect the selected routes, calculate the total length of the intersect.

Any help will be great, feel free to ask me to clarify on some things.

Thanks
~lance
0 Kudos
1 Reply
CedricWannaz
New Contributor II
Couldn't you just do the following? It would have the advantage to process everything in somehow a "vector" way, so you wouldn't have to loop over features..

1. Intersect both feature classes (e.g. paths, shortestPaths), keeping the attributes of both.
2. In the intersection feature class, discard entries with non-matching IDs (e.g. FID_paths, FID_shortestPaths), or create a new one or a layer, selecting only features with matching IDs (e.g. Make Feature Layer with SQL:  "FID_paths" = "FID_shortestPaths").
3. In the resulting feature class or layer, dissolve based on one ID field (e.g. one of FID_paths, FID_shortestPaths, which are equal).
4. Get the Shape_Length field from the output of the dissolve tool.

Best regards,

Cedric
0 Kudos