Hi, Please, does the number of nodes for OSM ways always corresponds to the physical distance? I noticed different streets(ways) have varying number of nodes, but what I'm not sure is if this actually consistently relates to distance of the streets. In other words, do streets with lower number of nodes have shorter physical distance than those with much higher number of nodes and vice-versa? Thanks for the much highly anticipated feedback! asked 31 Oct '22, 15:47 Segunlakata |
No, there is no relationship at all. Nodes are generally needed where a an object is not a straight line. So a long straight might be drawn with only 2 nodes, while a short curved street might have many nodes to draw the curve. Nodes are also needed to represent intersecting objects, so a street with many junctions will tend to have more than a street with no intersections. answered 31 Oct '22, 17:02 alan_gr Thank you @alan_gr. Your feedback has been of tremendous help. Now that it is clear that there is no correlation between the number of nodes under an OSM way and the physical distance of the way, how do I go about about computing the overall path length (distance) of an OSM way in a very accurate manner?. I also initially planned using the start node (start point) and the end node(end point) of a given way to compute the distance for the way, but I realize it won't give me the level of accuracy I desire (i.e. the computed distance could be less than the actual distance), particularly when the street is not a "perfectly" straight one. Does anyone have an idea please?
(01 Nov '22, 14:05)
Segunlakata
1
You have to calculate the distance between any consecutive nodes and then simply add these numbers up. Similar to any other graph.
(01 Nov '22, 15:18)
scai ♦
|