Question

I 'm using OpenStreetMap data in order to generate a graphs. My aim is to order the two kinds of points (buildings and intersections of roads) in each way. I have only the order of intersections and the order of buildings onto the street. I can't find a solution to merge the two types of points because i need finally graph which relate the different buldings and intersections. Is there a method to establish the order given that each point has a geographic position ( laltitude & longitude)?

thank you in advance

Was it helpful?

Solution

Good question. Basically it boils down to placing houses relative to intersections:

     |  12
-----+-------
  11 |

Now consider that in hilly terrain, roads will loop between intersections:

<main road<-------|
              5   +------> side road
>main road>-------|

There's no reasonable way to assign house number 5 to either road segment on the left, even though we know it's on the main road.

In general, you can assume roads are line segments between intersections, and just check which of the line segments is closest to the house position. The validity of this approach is perfect in say Kansas City and rather poor in a random Alpine ski resort.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top