logo separator

[mkgmap-dev] Unit tests for restrictions and other complex routines

From Gerd Petermann gpetermann_muenchen at hotmail.com on Wed Apr 16 08:05:43 BST 2014

Hi all,

I think the last days showed that unit tests around routing are missing or
to weak, else I should not have been able to build with so many stupid errors :-(

I'd like to add some unit tests, but I have a problem:
The existing input files don't contain (enough) restriction relations.

I thought about two possibilities:
1) Use JOSM to create all kinds of restrictions and the special cases
in an *.osm file, add it to mkgmap\test\resources\in\osm 
and process the file like in SimpleRouteTest to find out
if the number of saved restrictions is okay.

2) Create single unit tests that  produce small road networks 
to test edge cases like 'via' nodes on tile boundaries, 
'to' ways with loops, wrong angles (right_turn describes left_turn)
etc.

The advantage of 1) is that it also allows to test the created img file
in MapSource. The disadvantage is that it will only contain the special
cases that we know now and that it is difficult to find out if every special
case was treated correctly, we typically just count objects.
The advantage of 2) is that we can always add new test cases and
that the test is able to verify anything. The disadvantage is
that it is quite difficult to create a small road network in java and that the result
is not testable in MapSource. Unit tests should not be too complex,
else they will make living harder when something is changed by intention.

I see a similar need for other options like --process-exits, --process-destination, 
--make-opposite-cycleways, --adjust-turn-headings
which all involve rather complex routines or are likely to have 
side effects on other complex routines.

I think a good compromise would be a new small .osm (better .o5m or .pbf ) file 
containing real data with a good number of special cases and some new unit 
tests that use this data.

I think the fie should contain a part of a (large) city with motorways, trunks etc.
which is mapped by many different persons, so that we have different solutions
/errors. 
Any suggestions?
Or better ideas?

Gerd
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140416/30f25cbf/attachment.html>


More information about the mkgmap-dev mailing list