Select to view content in your preferred language

Measure a route without ignoring gaps

731
3
07-25-2013 09:44 AM
AinurMatayeva
New Contributor
My merged polylines are dashed...
I tried "create routes" tool (unchecked ignore spatial gaps), but it gives me the length of lines.
and I need to know length of lines with gaps.
unfortunately ET geowizards is not free...

any idea?
Tags (2)
0 Kudos
3 Replies
RichardFairhurst
MVP Alum
My merged polylines are dashed...
I tried "create routes" tool (unchecked ignore spatial gaps), but it gives me the length of lines.
and I need to know length of lines with gaps.
unfortunately ET geowizards is not free...

any idea?


Assuming the measures of the routes are based on route length and monotonic just extract the From and To measure and take the difference of the To measure minus the From measure to get length with gaps.

Python:  !SHAPE.FIRSTPOINT.M! and !SHAPE.LASTPOINT.M! get the From and To measures respectively

You could directly calculate a Route_Length field that includes gaps with the calculation:

!SHAPE.LASTPOINT.M! - !SHAPE.FIRSTPOINT.M!

Non-monotonic routes (routes that do not have increasing measures at each successive vertex) have to be fixed before you can get an accurate value.
0 Kudos
AinurMatayeva
New Contributor
thank you Richard.

it doesn't work out for me because of non-monotonic routes... (it looks like a river)
and the gaps are sometimes huge...

i am wondering if it is possible to do it automatically in my case...
0 Kudos
RichardFairhurst
MVP Alum
thank you Richard.

it doesn't work out for me because of non-monotonic routes... (it looks like a river)
and the gaps are sometimes huge...

i am wondering if it is possible to do it automatically in my case...


Nope, there is nothing automatic with non-monotonic routes, since their gaps cannot be traced like a monotonic route.  If they are non-monotonic they will double back to the same measure over and over or reach an end of connected lines and then randomly jump to another end.  I know of no way to distinguish a gap from a double back.  There is no such thing as a measurement of the gaps in such a configuration from my perspective.  You would have to create a set of monotonic route pair segments that include a gap you want included in the measure values and eliminate the pairings you do not want to count as gaps, and there is no real rule set for doing that automatically.  In any event, what you want would most likely make no sense if it were applied to non-monotonic roads and the rules you would follow to straighten it out would almost certainly violate the rules I would follow for roads.

What is the total distance that traces the strands of spaghetti on a plate including gaps?  You can measure the actual spaghetti for length, but what ends of the spaghetti strands constitute a gap you want to measure?  That is the sort of problem non-monotonic routes can pose, and at some point you have to accept that there is no solution unless you are willing to impose an artificial order.  While rivers are more ordered than spaghetti, the problem has more in common with that end of the spectrum than it does with a monotonic road with a break that will be filled by future construction.
0 Kudos