OpenStreetMap

Random bus routes

Posted by mwbg on 13 November 2013 in English.

Still interested in mapping bus routes as relations. Decided to see if I could tidy up any body else’s.

Oh dear. What’s going on here ? Every bus route relation that I’ve looked at has all the way segments in random orders, even to the extent of mixing the southbound and northbound routes up. Going to spend hours putting them all in the right order.

This got me thinking. Was there ever a time when relations were not ordered ? There seems to be a contingent of people who want to put numbered roles next to bus stops for example. Also, I’ve noticed that OSMRM never seems to show sub-relations in a sensible order, keeping saying “3km to next segment” when the next segment actually adjoins it !

What’s going on here ?

Discussion

Comment from srbrook on 13 November 2013 at 23:45

Sorting relations using JOSM is not that difficult and I have done it for walking routes many times. 1. Find the number of the relation and download it into an empty editor using the File->Download Object menu item. 2. Open the relation in the editor. 3. Select the start of the route on the map and find the selection in the relation editor. 4. Move the start to the top of the list and while the item is selected press the ‘sort the relation members’ button. 5. Move down the list until a gap is indicated and zoom to that area. most gaps are because a way meets at a ‘T’ junction or these is a missing member of the relation. Download a small area round the gap and repair it by cutting and removing the wrong bit or adding the missing bit to the relation. 6. Press the sort button again and the gap should be fixed. 7. Sometimes a section needs to be reversed - select it and press the ‘Reverse the order of the members’ button. 8. Sometimes a section needs to be moved up or down - select it and use the move selection up or down buttons. tip: put a temporary ‘x’ in the role box (at the gap) so you can see where it has to move to. 9. Right clicking on a relation member has some useful tools for navigating the editor list and zooming the map to see members.

Hope this reduces the hours you expected to have to spend doing this.

Comment from Richard on 14 November 2013 at 07:34

“Was there ever a time when relations were not ordered?”

Yes. Relation ordering was introduced with API 0.6. Relations were not ordered in API 0.5.

Relation ordering is still optional and most tools don’t make use of it. By all means order relations if it makes you happy, but with rare exceptions (e.g. buses that pass over the same section twice), ordering can and should be derived algorithmically.

Comment from Vincent de Phily on 14 November 2013 at 10:18

Is there any relation type or tool that makes use of relation member’s order ? To me this has always been purely cosmetic, helping humans find gaps for example, but otherwise useless ?

Comment from mwbg on 14 November 2013 at 10:50

Vincent de Phily: I don’t know about tools but, until now, the notion that a relation could be unordered had never occurred to me. I’m currently using relations to map bus routes, where the order certainly is significant: it makes a difference whether a bus branches “this” way or “that” way, and whether it does so in the nb/sb direction, and whether it does so on the first/second pass of a self-crossing loop.

Current guidelines for route=bus expect the stops to be kept in_order and either “all before” or “all after” the set of ways.

I don’t know about other uses of relations, but for transport routes which are anything other than plain linear, it damn well does make a difference, and certainly is not cosmetic.

Comment from mwbg on 14 November 2013 at 10:57

srbrook: yes, I was sort of aware about how to sort, move, reverse (subsets of) the ways in a relation but, as I’ve pointed out elsewhere, with the case of self-crossing bus routes, to do sorting like this would break (or at least “flatten”) the route, making it rather pointless. As I understand it, you’re a cycle person and can thus follow what ever subset of a cycle route you like. If you’re using buses (or even trains), you don’t get a choice: if the bus serves this road before serving that road, in a distance-inefficient way, then that’s what it does. People who are not regular bus users are perhaps not aware of this.

You could have a route that follows A->B->C->D->E->C->B->C->E, all in the same “outward” direction. Without ordering, it would just look like A->B->B->C->C->D->E. You wouldn’t be able to tell that it had two loops and one reversal in it.

I’ve even seen some relations that omit the “forward/backward” distinction, making it completely ambiguous, even for a human being.

Log in to leave a comment