# Algorithm to find distance of an uneven polygonal road

### #1 Gauravjasraj Posted 21 June 2012 - 12:53 AM

Gauravjasraj

Newbie

• New Member
• 1 posts
• India

Hi,
While working for my summer internship I have got a task to implement an algorithm to find the crosssecting points of two roads or more and then place that cross-section point a number and then find the distance of the previous roads to the new point and update it in the table. I tried Ramer douglas peucker line simplification algorithm to convert the road into a straight line and then find the intersection point but the point coming after this is not exactly the cross section point and the distance coming is also not the exact. Please help.

### #2 Hans van der Maarel Posted 21 June 2012 - 02:15 AM

Hans van der Maarel

CartoTalk Editor-in-Chief

• 4,166 posts
• Gender:Male
• Location:The Netherlands
• Interests:Cartography, GIS, history, popular science, music.
• Netherlands

Hi,
While working for my summer internship I have got a task to implement an algorithm to find the crosssecting points of two roads or more and then place that cross-section point a number and then find the distance of the previous roads to the new point and update it in the table. I tried Ramer douglas peucker line simplification algorithm to convert the road into a straight line and then find the intersection point but the point coming after this is not exactly the cross section point and the distance coming is also not the exact. Please help.

Well, for starters, don't simplify the lines because that changes the geometry and makes your results incorrect.

In general terms, you'll want to intersect the roads. This splits the original roads on their intersection point and creates new objects. Then you can calculate the length of those new roads. I think that should do the trick.
Hans van der Maarel - Cartotalk Editor
Red Geographics