I have a Linear Referencing Route System in ArcGIS Geodatabase format (polylines with M values) and a separate polyline feature class of short segments (called TMC) that do not have RouteIds currently. The Linear Referencing Routes are directional. So, there will be two long lines on top each other in most locations in the Route layer where there are two-way routes, with RouteIds like 1001 and 1002 and these are digitized in opposite directions.

How can I assign the appropriate RouteIds to the TMC segment layer based on the digitized direction of the TMC segments?

I only need to assign RouteIds when the TMC is approximately parallel to an existing Route and within 100 ft of the Route? We need to ignore the TMCs which do not meet these criteria. So, if a TMC segment intersects a Route, but is perpendicular to it, it should not be assigned a RouteId.

  • Do you ignore TMC's that start and end on different routes? Do you need to assign start and end measures too, or just route-ids? Oct 5, 2011 at 21:49
  • @KirkKuykendall: Excellent question. I need to split TMCs that start and end on different Routes. If there is a good way to do that, please add to the solution. I have tools to assign measures, so assigning measures is not a problem. Assigning correct RouteId is the biggest problem. Oct 5, 2011 at 22:07
  • Is a programmatic solution acceptable? Oct 6, 2011 at 1:30

2 Answers 2


I think the keyword here is "approximately parallel". So my program would first find the parallel TMCs to each route i.e.

  1. Loop through the route geometries

  2. For each line calculate its slope

  3. Now find the TMCs that are within your tolerance of 100ft. These are your candidate TMCs

  4. For each of these TMCs calculate the slope

  5. Compare the slopes. If they are within a threshold ("approximately parallel") - AND they dont already have a routeid assign them the route id.

Once you do that you can then move on to the splitting:

  1. Loop through your TMCs this time

  2. Get the first and end point for each

  3. Find the projected points on to the route with the same id for start and end.

  4. If either the start or (only?) the end does not fall within the route geometry, you will need to perform the opposite 'projection' i.e. find the end point of the route (assuming both TMC and route run in the same direction) and project that point onto the TMC and use it for the split.

  • I think your answer is getting there. One issue is Routes may not be straight lines end to end. Most cases they are, but there are cases where they are half circles around town (loop roads). I am thinking I need to split up the TMC data and Route data into indvidual segments at vertices and do this analysis based on the individual segments. Does that sound better? Also, I am not restricted to ArcGIS. Will any of the open source tools or the new spatial features of SQL Server be better suited for this? Thanks for your input. Oct 6, 2011 at 18:25
  • I think so. In this case you would only straight lines to compare the slope for. You need to be careful though when you re-merge the routes and TMCs to get merged in the right order. Which I think you can solve by adding a new field in the new split shapefile/table so when you split them from start to end to add an integer from 0-n to keep the order.
    – mapoholic
    Oct 7, 2011 at 7:07
  • As for what to use- whaterver you are comfortable with- I would use python. Either arcpy or ggis python libraries. Both should include functions to get the projected point along a line and split. SQL Server Spatial tools also has some LRS functions: bitbucket.org/geographika/sql-server-spatial-tools
    – mapoholic
    Oct 7, 2011 at 7:17

One way to do this would be to create a topology that includes both the TMC's and the road centerlines. I'd start with a small cluster tolerance and use a must-be-covered-by rule to find places where TMC's are not near roads.

I would then write a program that creates a dictionary where the key is the oid of the TMC and the value is a list of road-centerline oids that fall along the TMC. Populate it by looping through each TMC and find each topology element that it belongs to.

Once you've got the dictionary you could loop through each TMC and assign it a route-id by looking up the route feature by oid. If performance is critical another dictionary of associating route centerline oids to route ids could be used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.