Longest section of road?

This may be unanswerable, but I’d like to find out how long (roughly) the longest ‘section’ of road is on OSM (maybe just for Europe, but USA as well if possible.)
By ‘section’ (there may be a more official term) I mean the amount of road that gets highlighted when it is clicked in an editor, and (I assume) has a unique ID. I have tried a few sections of motorway in the UK and haven’t seen anything longer than about 10km. (I’m not sure what defines how a road is segmented in this way; I would imagine that a motorway stretch between two junctions would be one long section, but it seems not.)

I’m writing an app and I could make calculations work much faster if I knew the longest road section that would be found anywhere. Actually I don’t really want to include motorways, only roads that can be legally cycled on. I’m sticking with 10km for now but if anyone knows of longer ones please let me know!

Hi. I don’t have a hard answer, but can offer a caution. Nothing keeps mappers in the future from combining road segments because they think it’s better that way. So the longest segment today might be surpassed tomorrow, in the absence of any hard limits. (I’m not aware of any hard limits.)

In my own area of Western Canada, a quick check brings up a handful of longer roads, such as https://www.openstreetmap.org/way/25675463 and https://www.openstreetmap.org/way/236596283 . In underpopulated areas, there’s little reason to split long roads into shorter ones.

If I got that right you want to know the longest way (that’s the term used in OSM) with highway=* ? I’ve never needed that info. Are you sure that you don’t need the longest distance between two consecutive nodes?
Here is an overpass query to find highways with length > 10000 m
http://overpass-turbo.eu/s/13Hm
Way 521247731 in Spain has > 30 km

way 847457243 :length=326km (but highway=construction)

A section Of the Birdsville Track in ne South Australia is 462km long
https://www.openstreetmap.org/way/186428588 with many others across inland Australia over 300km

Ok all, many thanks for answers. So much more than 10km! I need to think of a different method, or restrict the app to Europe.
Cheers.

Coming here through the weeklyOSM mentioning - you are all not even close:

https://www.openstreetmap.org/way/187792382
https://www.openstreetmap.org/way/332917817

1 Like

It sounds like you’re asking about OSM ways. But it’s not good to rely on that.

I did write a tool to find longest sections of connected OSM ways that match certain tags, eg “longest road named X” which might be useful to others.