Merge tiles to gmapsupp based on poly files

Hi all, the regular workflow for building maps is something like: 1. get osm pbf data for the region 2. split data using splitter.jar into rectangular tiles 3. build each tile 4. merge all map tiles into single gmapsupp.img But from my understanding, this raises issues on region boundaries when multiple regions (multiple gmapsuppXYZ.img files) are used on device. The data for an extract is usually defined by a .poly file, so everything outside of this polygon is not included. But splitter.jar splits not at polygon bounds but by rectangles of different sizes. So some tiles for a map contains not the full osm data for this rectangle because the data was already cut off during osm data extraction. For example, building the map for Germany and France by two separate osm extracts leads to missing data on the polygon bounds for these tiles. And I assume this breaks routing across maps. A better approach would be to split and build from the whole world (or at least Europe), then merge all tiles for Germany into gmap_germany.img and all tiles from France into gmap_france.img. The tiles on country borders must be included in both .img files but because they have the same map-id, the device should be able to take care of duplicated map tiles. The area of tiles can be defined by the same .poly file used in the regular workflow, but now as a selector for tiles instead of osm data. So because I don't see anything in the docs mentioning this workflow, I assume this is not how it works :-) What is the recommended workflow to build multiple maps and providing proper routing across multiple gmapsupp.img - or is this just not possible with Garmin devices? -- Best regards / Mit freundlichen Grüßen Daniel Vogelbacher

Hi Daniel, there should be no problems with routing, because a route should switch maps at the country border. See mkgmap option --add-boundary-nodes-at-admin-boundaries. If you don't like tiles without full content, then use bigger extract and smaller poly file as an option for splitter. See splitter option --polygon-file. Other possibility is to split bigger extract (for example Europe), convert all tiles to img and then create lists of tiles for each country you need (for example Germany and France). Then you can run again mkgmap with list of img as an input, to create separate maps. Unfortunately rectangle tiles causes a problem for address search. If you are near the border on a tile shared by 2 maps, then GPS could use wrong map for a search. Proper solution would be to have irregular tiles cut at an administrative border. This is how original Garmin maps are split into countries. -- Best regards, Andrzej

Hello Andrzej, thanks for your answers. On 7/14/22 21:34, Andrzej Popowski wrote:
Other possibility is to split bigger extract (for example Europe), convert all tiles to img and then create lists of tiles for each country you need (for example Germany and France). Then you can run again mkgmap with list of img as an input, to create separate maps.
How can this "lists of tiles" be generated? This was basically my question :) From all hundreds of generated map tiles, how can I reduce template.args (whole Europe) to template.de, template.fr etc. to process them individually to gmapsupp? -- Best regards / Mit freundlichen Grüßen Daniel Vogelbacher

Hi Daniel,
How can this "lists of tiles" be generated?
I'm doing it with Qgis and some scripts. General idea is to import tiles created by splitter as a layer to Qgis, add region attributes to tiles and export result as a csv file. Then I use awk script on csv to extract IDs of tiles with a selected attribute. This makes a list, which I use as an input to mkgmap. -- Best regards, Andrzej
participants (2)
-
Andrzej Popowski
-
Daniel Vogelbacher