How to tell if a node on a highway has coordinates on the actual highway?

So I’m making a project that requires knowing the particular geometry of highways (roads), and I’ve decided to pull the data of nodes that are on the highway, particularly their lat/lon. However, I’ve run some tests and realized that some nodes are not marked on the road itself, but rather on an adjacent building. I have looked for tags and such things that may help me differentiate between these nodes and the ones that actually describe the road geometry, but so far I’ve come up empty. Is there actually any way to do this?

1 Like

Kind of depends on the source data. Roads may have been hand traced from an overhead image that had an X/Y error. (appearing in nearby buildings) The fix then will be to refine the route accuracy with better imagery and/or multiple GPS trace logs before re-using the way node list.

Depending on the country/authority you may also be able to get roads in a public database. Many Australian States make that available for download for example. There will of course be data usage/copying conditions to adhere to.

I’m talking about the data in openstreetmap itself, each road has a bunch of different nodes listed under it. Many of them actually mark the road, but some of them are very obviously centered on the building next to the road (so it isn’t error). I’m asking if it’s possible to filter these out.

Would you please post a URL/example?

1 Like


This image shows the node data plotted. You can see that most of the points follow a road, but some of them are marking buildings or areas of interest (such as the one directly over Laurier University).

1 Like

Kind of difficult to figure out but I suspect the node list is not the actual road, or there is some kind of rounding error in the co-ords. How are you extracting the OSM data?

2 Likes

I’m using the overpass API, and calling .nodes() on the road. From what I know this gives me the same list that openstreetmap gives.

Yeah agreed. Overpass can do that. Suggest look at rounding issues, like not enough decimal places. If I was doing it I’d check by exporting a GPX and overlaying in viking etc.

Sorry have to run… (Lunchtime here)

I’ll look into it. Thanks for the help!

It might be the adresses, from an associatedStreet relation.

Would you really share the request you’re using, it does not look like a way!

1 Like