Tile clipping
A new feature has been added to mkgmap to clip all features exactly to a bounding box. This allows you to create tiles that meet exactly without overlapping. The general idea is that you start with an area that is slightly larger and then chop it down with in mkgmap. It will work even if a line crosses the area without any nodes being inside. The example uses osmosis, but any software that adds the bound element to the osm file will work and I will probably add an option to specify the bounding box manually later as well.
This is quick example that I made to try it out. Normally you would probably have larger tiles. First I ran osmosis on a uk osm file to create two small tiles. Two bounding boxes were created that shared a vertical side at -0.24 degrees longitude.
osmosis --rx uk-080623.osm.gz enableDateParsing=no \ --tee 2 outPipe.0=a outPipe.1=b \ --bb inPipe.0=a completeWays=yes top=51.65 bottom=51.55 left=-0.34 right=-0.24 \ --bb inPipe.0=b completeWays=yes top=51.65 bottom=51.55 left=-0.24 right=-0.14 \ --wx uk-test-1.osm.gz \ --wx uk-test-2.osm.gz
The completeWays argument makes osmosis include the whole way when any part of it is inside the bounding box. This is essential otherwise there will be gaps between the tiles. Thats all there is to it really. You can now run mkgmap on those tiles normally.
A picture probably says it better than words. Here you can see the clipping in action in QLandkarte displaying one of the tiles produced. This screenshot was taken before points were excluded from the bounding box, which is why you can see a few stray ones outside the box.
Here is what the same data file would look like before clipping.