logo separator

[mkgmap-dev] [Patch v1] Simple data integrety check for mkgmap

From Gerd Petermann GPetermann_muenchen at hotmail.com on Thu Aug 17 10:38:48 BST 2017

Hi all,

not sure if this is usefull:
It happened a few times in the past that either I/O errors or  badly merged data caused invalid coordinates. 
As a result, mkgmap shows rather misleading error messages as reported by Walter:
http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2017q3/026994.html

The attached patch implements a simple check:
Calculate the bounding box for each way with the tag building=yes and print an error message when the bbox is > 1000 garmin units in width or height.
If more than 10 such objects were found the tile is not processed.
The calculation is done before style processing and it is simple, so performance is no issue.
I've checked also some good files to make sure that it doesn't produce (too many) false positives.

One small problem: If the style files for ways don't check the building tag at all the tag is removed and therefore the test might not work.
I can change that but I think most styles evaluate the tag.

What do you think? Do we need paramters to control this ?

Gerd
P.S.
A sample output for the corrupted tile from Walter looks like this, please suggest better messages if you don't like them:
Time started: Thu Aug 17 11:34:23 CEST 2017
SCHWERWIEGEND (StyledConverter): e:\walter\50100031.o5m: Data integrety check failed: Building polygon has huge bbox http://www.openstreetmap.org/way/186387851
SCHWERWIEGEND (StyledConverter): e:\walter\50100031.o5m: Data integrety check failed: Building polygon has huge bbox http://www.openstreetmap.org/way/186387875
...
SCHWERWIEGEND (StyledConverter): e:\walter\50100031.o5m: Data integrety check failed: Building polygon has huge bbox http://www.openstreetmap.org/way/219675499
SCHWERWIEGEND (StyledConverter): e:\walter\50100031.o5m: Data integrety check failed: Building polygon has huge bbox http://www.openstreetmap.org/way/219675542
SCHWERWIEGEND (StyledConverter): e:\walter\50100031.o5m: Data integrety check failed: Building polygon has huge bbox http://www.openstreetmap.org/way/219675525
SCHWERWIEGEND (MapFailedException): e:\walter\50100031.o5m: (thrown in StyledConverter.end()) Input file seems to be corrupted, counted 826 unplausable objects
Number of MapFailedExceptions: 1
Number of ExitExceptions: 0
Time finished: Thu Aug 17 11:34:33 CEST 2017
Total time taken: 9888ms

-------------- next part --------------
A non-text attachment was scrubbed...
Name: data-integrety-check-v1.patch
Type: application/octet-stream
Size: 2951 bytes
Desc: data-integrety-check-v1.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20170817/ce7c0f4d/attachment.obj>


More information about the mkgmap-dev mailing list