Garmin uses overlapping tiles

Hi all, so far I've never seen the crash in MapSource using the Garmin maps, although they also have tiles with "invalid heights" and therefore the tile headers have the "Extra flag". my idea: - use mkgmap to create DEM data for exactly the same two areas as in a Garmin map [1] - Try to reproduce the crash with those two areas - replace Garmin DEM by mkgmap DEM and see what happens in MapSource The interesting point: Garmin tiles overlap. I've created this areas.list from the information in two Garmin TRE files: 00000029: 2174824,745652 to 2190360,768956 # 46,6667,16,0000 47,0000,16,5000 00000030: 2174824,768952 to 2190360,792260 # 46,6667,16,4999 47,0000,17,0001 Note that the first tile has eastern border at 768956 while the 2nd uses 768952 for the western border. When I use exactly those values I cannot reproduce the crash. When I move the boundary of one of the two tiles so that they are equal I can reproduce the crash, but not always with the same routes. I tried 768952, 768954, 768956. So, I tried to change mkgmap so that it calculates DEM as if the tile boundaries are overlapping, but with TRE where tiles have same 768956 --> crash possible. The next interesting point is that the 0x4a polygons of these two tiles do NOT overlap. They seem to share 768896 (!). So, I used a new areas.list with this value and still see the crash. My conclusion: We have to modify mkgmap to write a different TRE file, probably it has to cover the DEM area as well. Does that make sense? Gerd [1] TopoGuide Hungary 2.12c

Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ? regards thomas

Hi Thomas, I think the problem is that the relation is broken. Splitter writes it to both tiles, but mkgmap seems to have problems with it. Anyway, the problem is in the data and should be fixed in OSM. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 12:50 An: Development list for mkgmap Betreff: [mkgmap-dev] splitter r590,wrong handling of relations Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ? regards thomas _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, i have now made a different split, so that 1 tile contains the whole isle. In this case it looks good. I assume, that the relation is okay. No idea what should be changed in data. Also i have looked before with JOSM in the old split and confirm, that in the left tile the relation also exists, but not rendered from mkgmap. I can't judge, if the relation is broken or not. Therefore the problem is in mkgmap ? I thomas -------------------------------------------------- Von: "Gerd Petermann" <gpetermann_muenchen@hotmail.com> Datum: Dienstag, 6. Februar 2018 12:15 An: "Thomas Morgenstern" <webmaster@img2ms.de>; "Development list for mkgmap" <mkgmap-dev@lists.mkgmap.org.uk> Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
I think the problem is that the relation is broken. Splitter writes it to both tiles, but mkgmap seems to have problems with it. Anyway, the problem is in the data and should be fixed in OSM.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 12:50 An: Development list for mkgmap Betreff: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ?
regards thomas
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Thomas, the relation is broken. Use JOSM validator and it will report 2 errors. I think this way https://www.openstreetmap.org/way/556302821 should not belong to it and a few nodes should be merged to repiar it: node 4298102908 node 4298102907 node 655141348 Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 14:35 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations Hi Gerd, i have now made a different split, so that 1 tile contains the whole isle. In this case it looks good. I assume, that the relation is okay. No idea what should be changed in data. Also i have looked before with JOSM in the old split and confirm, that in the left tile the relation also exists, but not rendered from mkgmap. I can't judge, if the relation is broken or not. Therefore the problem is in mkgmap ? I thomas -------------------------------------------------- Von: "Gerd Petermann" <gpetermann_muenchen@hotmail.com> Datum: Dienstag, 6. Februar 2018 12:15 An: "Thomas Morgenstern" <webmaster@img2ms.de>; "Development list for mkgmap" <mkgmap-dev@lists.mkgmap.org.uk> Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
I think the problem is that the relation is broken. Splitter writes it to both tiles, but mkgmap seems to have problems with it. Anyway, the problem is in the data and should be fixed in OSM.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 12:50 An: Development list for mkgmap Betreff: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ?
regards thomas
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Thomas, I've just fixed the relation [1], so please try again with a fresh download tomorrow. Gerd [1] https://www.openstreetmap.org/changeset/56139020 ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Dienstag, 6. Februar 2018 14:47 An: Thomas Morgenstern; Development list for mkgmap Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations Hi Thomas, the relation is broken. Use JOSM validator and it will report 2 errors. I think this way https://www.openstreetmap.org/way/556302821 should not belong to it and a few nodes should be merged to repiar it: node 4298102908 node 4298102907 node 655141348 Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 14:35 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations Hi Gerd, i have now made a different split, so that 1 tile contains the whole isle. In this case it looks good. I assume, that the relation is okay. No idea what should be changed in data. Also i have looked before with JOSM in the old split and confirm, that in the left tile the relation also exists, but not rendered from mkgmap. I can't judge, if the relation is broken or not. Therefore the problem is in mkgmap ? I thomas -------------------------------------------------- Von: "Gerd Petermann" <gpetermann_muenchen@hotmail.com> Datum: Dienstag, 6. Februar 2018 12:15 An: "Thomas Morgenstern" <webmaster@img2ms.de>; "Development list for mkgmap" <mkgmap-dev@lists.mkgmap.org.uk> Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
I think the problem is that the relation is broken. Splitter writes it to both tiles, but mkgmap seems to have problems with it. Anyway, the problem is in the data and should be fixed in OSM.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 12:50 An: Development list for mkgmap Betreff: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ?
regards thomas
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thank you :-). Yesterday I had send a message to the Author Javier Sanchez ..... thomas -------------------------------------------------- Von: "Gerd Petermann" <gpetermann_muenchen@hotmail.com> Datum: Mittwoch, 7. Februar 2018 06:24 An: "Development list for mkgmap" <mkgmap-dev@lists.mkgmap.org.uk> Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
I've just fixed the relation [1], so please try again with a fresh download tomorrow.
Gerd [1] https://www.openstreetmap.org/changeset/56139020
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Dienstag, 6. Februar 2018 14:47 An: Thomas Morgenstern; Development list for mkgmap Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
the relation is broken. Use JOSM validator and it will report 2 errors. I think this way https://www.openstreetmap.org/way/556302821 should not belong to it and a few nodes should be merged to repiar it: node 4298102908 node 4298102907 node 655141348
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 14:35 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Gerd, i have now made a different split, so that 1 tile contains the whole isle. In this case it looks good. I assume, that the relation is okay. No idea what should be changed in data. Also i have looked before with JOSM in the old split and confirm, that in the left tile the relation also exists, but not rendered from mkgmap. I can't judge, if the relation is broken or not. Therefore the problem is in mkgmap ? I thomas
-------------------------------------------------- Von: "Gerd Petermann" <gpetermann_muenchen@hotmail.com> Datum: Dienstag, 6. Februar 2018 12:15 An: "Thomas Morgenstern" <webmaster@img2ms.de>; "Development list for mkgmap" <mkgmap-dev@lists.mkgmap.org.uk> Betreff: Re: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Thomas,
I think the problem is that the relation is broken. Splitter writes it to both tiles, but mkgmap seems to have problems with it. Anyway, the problem is in the data and should be fixed in OSM.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Thomas Morgenstern <webmaster@img2ms.de> Gesendet: Dienstag, 6. Februar 2018 12:50 An: Development list for mkgmap Betreff: [mkgmap-dev] splitter r590,wrong handling of relations
Hi Gerd, i found out, that splitter r590 can not proper handle the relation 2.691.138. I can reproduce the problem. It makes no different, if I splitt the canary-islands-latest.osm.pbf with the default-option or with my own splitt.list. If I move the tileborder by changing the nord-south border, also the problem is moved. See picture at http://img2ms.de/OSM/ErrorInSplitter-r590.jpg. At the tile-boundary splitter creates only for the rightsite tile the polygon for tag boundary=protected_area , respektive leisure=nature_reserve. In the leftsite-tile this tags are missing. maybee you can have a look at that ?
regards thomas
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, I have some questions. Is TRE area bigger than DEM area or tiles overlap but still DEM area is bigger than TRE? It looks like overlap is 4 Garmin's units, this is less than DEM raster size.
The next interesting point is that the 0x4a polygons of these two tiles do NOT overlap. They seem to share 768896 (!).
Is it a typo? I guess: polygon 0x4B and 768856 Does map data overlap too, or this is only extended rectangle size written to TRE header? If backgrounds don't overlap, maybe real map data don't either. If I get border value right, than maybe tile is extended only at left and top border? What about routing nodes, if splitter creates overlapped tiles? I think there should be an external routing node where road crosses tile border. There would be mismatch, if tiles overlap. -- Best regards, Andrzej

Hi Andrzej, hard to say where exactly the DEM area ends on the right / bottom side. I got the info about 0x4a polygons from GPSMapEdit looking at the basemap. MapSource shows the tile boundary more or less exactly at E16.5, so I have no idea whrere the 0x4a value comes from. I don't plan to change splitter, I want to change the TRE file written by mkgmap. Working on a patch right now ... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Dienstag, 6. Februar 2018 14:57 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Garmin uses overlapping tiles Hi Gerd, I have some questions. Is TRE area bigger than DEM area or tiles overlap but still DEM area is bigger than TRE? It looks like overlap is 4 Garmin's units, this is less than DEM raster size.
The next interesting point is that the 0x4a polygons of these two tiles do NOT overlap. They seem to share 768896 (!).
Is it a typo? I guess: polygon 0x4B and 768856 Does map data overlap too, or this is only extended rectangle size written to TRE header? If backgrounds don't overlap, maybe real map data don't either. If I get border value right, than maybe tile is extended only at left and top border? What about routing nodes, if splitter creates overlapped tiles? I think there should be an external routing node where road crosses tile border. There would be mismatch, if tiles overlap. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, I guess basemap is overview map. 0x4A objects are derived form backgrounds of detailed tiles, but with resolution of overview map, it would be difficult to guess, if background overlap or not. I hope extending values written to TRE will work. -- Best regards, Andrzej

Hi Andrzej, changing the TRE bounds helps sometimes, but not always :-( @Frank: All Garmin TRE files that I looked at where aligned to multiples of 4 map units. I tried this as well as aligning to multiples of 2, nothing worked without crashes so far. Anyhow, it seems to be the right thing to look at. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Dienstag, 6. Februar 2018 15:49 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Garmin uses overlapping tiles Hi Gerd, I guess basemap is overview map. 0x4A objects are derived form backgrounds of detailed tiles, but with resolution of overview map, it would be difficult to guess, if background overlap or not. I hope extending values written to TRE will work. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi experts, this is quite complex. My current understanding is this: 1) Garmin maps can have overlapping areas in TRE, boundaries are stored with 24 bit resolution rounded to either multiples of 2 or 4. Overlaps are also either 2 or 4. In current mkgmap maps there is no overlap. 2) The *.tdb file in Garmin maps describes areas that do not overlap. The boundaries are stored in 32 bit resolution, probably not rounded. 3) The DEM areas in Garmin maps overlap even the TRE areas and only the position of the upper left corner is explicitly stored in 32 bit resolution, and is always a multiple of the dem-dist. The position of the lower right corner could be calculated but I assume that it is not important. Changing the boundaries in TRE has an effect reg. the crash. Changing the position of the upper left corner boundaries in DEM has an effect reg. the crash. Changing the position of the lower right corner and therefore the overlap has an effect reg. the crash, probably the current code in mkgmap is off by one in both directions (too small). The current code in mkgmap calculates the *.tdb file boundaries from the TRE boundaries. This might cause problems when I change the code to write TRE boundaries that overlap. Maybe we have to align tiles to certain multiples, maybe it is sufficient to align the TRE boundaries to certain values. I still did not find a working rule. The TRE bounds may depend on the DEM dist value or on certain prefered values, maybe there is a flag in the DEM or TRE header that has to match. Maybe the DEM bounds depend on the TRE bounds, maybe the *.tdb file also is important here. Please let me know if you find different results in routable Garmin maps with DEM. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Dienstag, 6. Februar 2018 16:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Garmin uses overlapping tiles Hi Andrzej, changing the TRE bounds helps sometimes, but not always :-( @Frank: All Garmin TRE files that I looked at where aligned to multiples of 4 map units. I tried this as well as aligning to multiples of 2, nothing worked without crashes so far. Anyhow, it seems to be the right thing to look at. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Dienstag, 6. Februar 2018 15:49 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Garmin uses overlapping tiles Hi Gerd, I guess basemap is overview map. 0x4A objects are derived form backgrounds of detailed tiles, but with resolution of overview map, it would be difficult to guess, if background overlap or not. I hope extending values written to TRE will work. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (4)
-
Andrzej Popowski
-
Gerd Petermann
-
Gerd Petermann
-
Thomas Morgenstern