Is there a way to get the total distance and distance of the different types of ways that make up a relation such as this one? https://www.openstreetmap.org/relation/2954632 For example I'd like to know how many kilometers of divided motorway, non-divided primary, etc. make up this route. Do I need to hire a programmer or is there an Overpass query that can generate this kind of data? asked 30 Mar '21, 19:50 mdchachi |
Some of this information is available with no programming from the Relation Analyzer tool: http://ra.osmsurround.org/analyzeRelation?relationId=2954632&_noCache=on By downloading the Way Distribution you can see that this example is almost entirely highway=trunk. Note that the main highway tag in OSM does not necessarily map directly to concepts such as "divided highway", this tends to be quite country-specific. answered 30 Mar '21, 21:10 alan_gr |
I would like to suggest https://overpass-turbo.eu/s/15BQ:
Lines 4 and 10 express that you want to sum by the value of the highway tag and could be replaced by another expression. Lines 3 and 10 ensure that oneways and none-oneways are processes separately. Line 6 has a division by 2 to count oneways only with half of their length. answered 30 Mar '21, 21:27 Roland Olbricht |