If I route from 145.01050°E, 37.82786°S to 145.01051°E, 37.82779°S the route jumps from the lower track to the upper track which is not possible. The other thing is that one line goes east-west and the other goes west-east. The node is tagged as railway=railway_crossing, and the ways have
railway=rail and oneway=yes. Is there a way to stop this happening (as I have to traverse the node)
In short: you basically need to treat nodes with railway=railway_crossing just like a restriction=only_straight_on relation. To figure out the traversable directions, you would need to check the angles between the tracks. Presumably you already have logic to prevent impossible movements at railway=switch nodes based on the angle? If not, this implementation might provide some inspiration.
railway:preferred_direction=* and railway:bidirectional=* should be used instead of oneway=*, since railways are not strictly one-way in the sense that roadways are. Unless the line truly lacks opposite-direction signals, this move would just be unlikely, not illegal.
Cheers for those great hints. I was not aware of the geofabrik openrailrouting stuff so will check it out. I had started from foot.lua which had oneway as conditional. Changing that did not stop the turning. At the moment I enjoy my version where I can hop on and off trams and trains at any road/foot junction %-). I have some way to go.
I agree, but for unknown historical reasons AU and NZ use oneway. Presumably because oneway is rendered by editors, while railway:preferred_direction=* and railway:bidirectional=*, are not. I’ve opened this PR in iD as an attempt to make it support the railway tags, so that there’s no reason dislike the proper railway tags.
Actually looking into this I have discovered that generally platforms appear not to be linked to the actual rail/tram ways. I had been ignoring the ways connecting from “roads/paths” directly to “rail/tram” with no platform nearby. Perhaps this is the standard situation. I will look at other cities to see if this is normal. I was just seeing how far it would be to walk from the around Melbourne C ity to the Dandenongs using public transport. By tram only would be about a 15.7k walk at the end. Using train reduced it to about 4k. The two major issues would be to have ways linking to the public transport infrastructure, and to only connect at “platforms”.
I briefly looked at Zurich (Way: Bahnhofplatz/HB (129783415) | OpenStreetMap) and it appears it may have what I need. The tool sounds interesting but I will first work out what needs to be done.
Cheers
The Zurich network also does not link platform to rail/tram.
So the simple approach to this does not work. The OSM data is really multiple networks in the same dataset. When supporting road/foot and tram or rail in the same profile you can jump from road to rail at any shared node. to stop this happening would require too many restrictions. If there was from any to road way to any tram way via any node restriction = block that would solve part of the problem. it would be also and ways connecting platforms (in road network) to tram ways with a “restriction” allowing access to/from platform and tram.
As told “Just use Transport Victoria Journey Planner mate.” %-)
However, this rarely works in Melbourne, because it relies on mappers using newer tags like local_ref, and mapping each stop_position node and stop_area relation.
In a few places like Sydney it works because various people have taken the time to map it perfectly (example). I use this convoluted overpass query to grab all the stop_positions and the platforms that they’re linked to.