[Routing] Errors in map data that affect correct routing - and what to do about it...

Scott, Cathy C.Scott at napier.ac.uk
Mon Jan 5 09:52:48 GMT 2009


Hi everyone,
Thank you for all your feedback. 
It's good to know that my assumption concerning these errors was correct..

I will be looking at my routing code to make sure that it is robust enough to handle errors like these when it finds them.

In terms of identifying them I did look at the OSM Inspector tool but it didn't seem to identify any of the Ways that I am having problems with. 
My database is a copy of the relevant part of planet.osm but I have done a small amount of pre-processing. This was to remove as many of the Ways/Nodes that are not needed for vehicle routing i.e. taking out buildings, parks etc. Most of these are closed polygons so there will always be a repeat of at least one node at beginning and end.
This is how I went about looking for potential Ways with problems. I queried the way_nodes table for those Ways where the number of rows was greater than the number of distinct node_id. Now many of the results will still be valid Ways for example roundabouts or roads with loops. However I can then iterate through these Ways and find all those rows that have the same node_id immediately following. Gerhard - I already have this query written - any use to you?

Does the OSM Inspector tool do this kind of checking?

In terms of other pre-processing of the OSM data for routing I did consider removing all nodes that had degree 2 - i.e. all those that are in the middle of a Way and not at a junction. However this would remove a lot of useful information. My algorithms will be optimizing on several different criteria for the same route e.g. length, slope, height climbed. Particularly for height and slope these costs are directed i.e. the cost of A -> B is not the same of B -> A. At present I am only optimizing at one criteria at a time but this will change to optimize on two or more. That then becomes a lot of additional information that must be preprocessed. However maybe it is something that I should consider. 

Wolfgang - you mentioned breaking Ways at crossings with other Ways. Do you not then lose information about how the Ways interact? I haven't looked closely at the data in Edinburgh yet but I was hoping that the manner in which Ways cross each other would give me information on which Way has 'right of way'., i.e. if 2 Ways meet at a node such that the degree of the node is 3 or 4 and the junction is not a traffic light or roundabout then one of the Ways is a 'major' road and traffic on it has priority, the other is then a 'minor' road and traffic on it must 'give way'. It may not always be possible to tell from the tagging which road is the 'major' but in some cases a hierarchy should give it i.e. highway=unclassified gives way to highway=primary. 

In terms of all the tags I am sure that there is a lot of useful information I could use. Traffic lights/roundabouts/turn restrictions at nodes as well as road surface like cobblestones. I have really only just started on different metrics that I could use and it will take me a while to figure out each one. 

In the meantime I just need to get around the invalid data...

Thanks again,
Cathy
Napier University is the best modern university in Scotland* and number one in Scotland for graduate employability**
(*Guardian University Guide 2009)
(**HESA 2008)

This message is intended for the addressee(s) only and should not be read, copied or disclosed to anyone else outwith the University without the permission of the sender.
It is your responsibility to ensure that this message and any attachments are scanned for viruses or other defects. Napier University does not accept liability for any loss or damage which may result from this email or any attachment, or for errors or omissions arising after it was sent. Email is not a secure medium. Email entering the University's system is subject to routine monitoring and filtering by the University.
Napier University is a registered Scottish charity. Registration number SC018373






More information about the Routing mailing list