Extract Looped Road Network

3223
12
01-19-2014 08:37 PM
shivamparashari
New Contributor
Hi,

I have a road network (polyline) having some dangled nodes and looped roads. I want to extract those looped roads(marked inside blue color). Is there any possibility to do that. Thanku in advance.

(:[ATTACH=CONFIG]30622[/ATTACH]
Tags (1)
0 Kudos
12 Replies
RichardFairhurst
MVP Honored Contributor
Hi,

I have a road network (polyline) having some dangled nodes and looped roads. I want to extract those looped roads(marked inside blue color). Is there any possibility to do that. Thanku in advance.

(:[ATTACH=CONFIG]30622[/ATTACH]


For the roads that form 3/4 loops use the sinuosity formula (distance between line ends/ length).  See this post.  For the complete loop roads that are not merely the ends of a straight road the same formula should work.  This assumes the lines are complete features for a given road name that are single-part or multi-part with out gaps.

For the loops that are just at the end of the road (like cul de sac bulbs) use the Create Route tool and find roads with MMonotonicity values that are 4 or above.  See this post for the MMonotonicity formula.
0 Kudos
shivamparashari
New Contributor
Hey,
Thank you so much for the instant help.

I have been working on it. Here, a problem is arrived that all the values are coming in 0's and 1's. There are no single values with 2's
or 3's, even the roads with curves.


Regards (:
0 Kudos
RichardFairhurst
MVP Honored Contributor
Hey,
Thank you so much for the instant help.

I have been working on it. Here, a problem is arrived that all the values are coming in 0's and 1's. There are no single values with 2's
or 3's, even the roads with curves.


Regards (:


I cannot reproduce what you are saying with this information.  Use the formula in the post I linked to which is line length / distance between line ends, not what I said in the first post or this thread, which was the opposite and should only produce values between 0 and 1.  If you used the incorrect ratio I described in my first post of this thread, the smaller the value of that ratio the more curved the line.

Are you calculating to a double field?  Which calculation are you referring to?  The ratios for sinuosity are mathematically sound (provided the ratio is done the same way as described in that thread).  Are you sure the lines are continuous through each curve?  If you used the correct formula, a value of 0 I would think would only occur with an error, like divide by 0 (a complete loop).  Is there any difference in the lines with the values of 0 from the lines with the values of 1?

The formulas work with projected layers that use linear measurements (feet/meters, etc).  They may not work on layers using degree measurements (decimal degrees or radians, etc).  I don't use unprojected layers, especially for road networks.  What are your coordinate system units?  Are you sure that length and the end point coordinates are coming back in the same units?

Anyway, I need more information about your exact steps to know where you are going wrong.
0 Kudos
shivamparashari
New Contributor
Hi,


I used the same formula in python-


!Shp_lngth! / math.pow(math.pow( !X_Start! - !X_End! , 2 ) + math.pow( !Y_Start! - !Y_End!, 2 ), 0.5) > 2

I used Projected Coordinate System, Added a new field in double and used the above formula in python.
The outputs are only displaying in 0s & 1s. I cannot understand on what basis it has calculated the values. Some lines with curves
are 1, some are 0 and vice-versa. I have entered values in meters and the output is also coming in meters. The problem is that the values are only in 0s and 1s 😞
0 Kudos
RichardFairhurst
MVP Honored Contributor
Hi,


I used the same formula in python-


!Shp_lngth! / math.pow(math.pow( !X_Start! - !X_End! , 2 ) + math.pow( !Y_Start! - !Y_End!, 2 ), 0.5) > 2

I used Projected Coordinate System, Added a new field in double and used the above formula in python.
The outputs are only displaying in 0s & 1s. I cannot understand on what basis it has calculated the values. Some lines with curves
are 1, some are 0 and vice-versa. I have entered values in meters and the output is also coming in meters. The problem is that the values are only in 0s and 1s 😞


That is the formula for the SQL to search the sinuosity if you have not calculated a single field value.  That calculation will only return a 1 or 0 (True or False) depending on whether the sinuosity value was greater than 2 (True - 1) or less than or equal to 2 (False - 0).  A sinuosity value of 2 is not going to catch all curved roads, only roads that are a certain level of curviness or above (you have to experiment to find the value that represents the level of curviness that you are looking for in your specific case and the shapes of curved roads vary so some level 2 sinuosity roads are seen as curvy and others are not seen as curvy enough for some purposes.  Level 4 and up should always be very curvy or angular, since acutely angled straight roads are considered sinuous). Perfectly straight roads would always be 0 with that calculation.

The calculation to fill in a Sinuosity field with the sinuosity value would just be:

!Shp_lngth! / math.pow(math.pow( !X_Start! - !X_End! , 2 ) + math.pow( !Y_Start! - !Y_End!, 2 ), 0.5)

Then you would use that field to test for sinuosity values (here is the equivalent SQL search after the field is calculated matching the expression you were using in your calculation):

"Sinuosity_Field" > 2

An acutely angled road can yield the same sinuosity value as a curved looping road using the calculation, but depending on your specific needs you may consider those two types of shapes the same or different.  Other tests would be necessary if you had to distinguish acutely angled roads from equivalently sinuous curved looping roads through a calculated value.

A relatively small curve in an otherwise straight road will have a very low sinuosity value, but it will always be above a value of 1 (which can only apply to a straight line), but it may not be above a value of 2.  Complete circles may cause an error and not calculate an accurate value (since the sinuosity of a circle is infinity and may cause a divide by 0 error).
0 Kudos
shivamparashari
New Contributor
Hey rfairhur24,

Thank you so much. That was just amazing !!! (:

All the non-terminating (looped) roads with one node have been extracted using sinuosity formula. Gracias

But yes the roads with more than one node are not extracted. I will do something for that. But yes, Thank you so much[ATTACH=CONFIG]30747[/ATTACH] 🙂 (y)
0 Kudos
RichardFairhurst
MVP Honored Contributor
Hey rfairhur24,

Thank you so much. That was just amazing !!! (:

All the non-terminating (looped) roads with one node have been extracted using sinuosity formula. Gracias

But yes the roads with more than one node are not extracted. I will do something for that. But yes, Thank you so much 🙂 (y)


The roads with more than one node (1/2 loops and 3/4 loops) can be extracted with the formula using a lower sinuosity value of about 1.5 or even as low as 1.2 (see the graphic in the second post of my sinuosity link above for values that would work), but it may end up just picking out 180 degree bent roads that do not connect to the same cross street.

Several other rules would potentially apply.  For example, you could require that both ends of an arc touch the same cross street road.  To determining that do the following:

1. Use the Intersect tool with the Point output option to extract the intersecting end points of the roads.  (Standard single point intersections won't work, you need every road end point)

2. Then perform a Spatial Join of the points to the street network using the One to Many option to get all of the touching roads name pairs (including self touching).

3. Then perform a Summary Statistics using the CenterlineFID created by the Intersect tool, the TargetFID created by the Spatial Join tool, the point street name of the points and the cross street names as the unique case criteria.

4. Then summarize that summary table with just the CenterlineFID created by the Intersect tool, the point street name of the points and the cross street names as the unique case criteria (drop the TargetFID).

5. Then select where the street name does not equal the cross street name (to exclude arcs that connect end to end with other segments of the same road) and the frequency value equals 2.

6 Relate the CenterlineFID of the summary to the ObjectID of the Centerlines and perform the relate.

7.  Select where the sinuosity is greater than 1.2 (or there about) to make sure there is at least some bend in the road to get rid of short segments that are just between two offset intersections of the same cross street (see the highlighted segment example in the screen shot),

You could also require that only one segment exists for the road.  To determine that just perform a Summary Statistics on the entire network first to discover single arc roads where the frequency value equals 1 and restrict your selection above to arcs in that set.
0 Kudos
shivamparashari
New Contributor
Hi,

The roads(lines) with same start and end points (nodes) have been extracted. Also, its working till the spatial join. Now, the problem
seems to be in the third point (Summary Statistics). I performed the summary statistics, but is doesn't seem to work according to my requirement.

[ATTACH=CONFIG]30884[/ATTACH]
0 Kudos
shivamparashari
New Contributor
One big issue is that, all roads have different names, so it is not possible to work it out with Spatial Join (with the same road name).
😞
0 Kudos