[PATCH v1] fix overview bounding box rounding

Thinking some more about what I was seeing in mapsource when mousing around the Baltic map, I came to the conclusion that the edges of the overview map bounding boxes where in the wrong place so I took a look at mkgmap where it rounds those coords and came up with the attached fix. No great theory here, I just dicked around until it worked as I expected. For the Baltic map, the mouse now works right up to each boundary in both lat and lon directions whereas before it would only work right on one side of each boundary. Please try the patch, especially for maps that are W of Greenwich and S of the equator and see if the overview boxes are right. Cheers, Mark

On 16.01.2010 12:03, Mark Burton wrote:
Thinking some more about what I was seeing in mapsource when mousing around the Baltic map, I came to the conclusion that the edges of the overview map bounding boxes where in the wrong place so I took a look at mkgmap where it rounds those coords and came up with the attached fix. No great theory here, I just dicked around until it worked as I expected.
For the Baltic map, the mouse now works right up to each boundary in both lat and lon directions whereas before it would only work right on one side of each boundary.
Please try the patch, especially for maps that are W of Greenwich and S of the equator and see if the overview boxes are right.
Cheers,
Mark
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev Nope, still broken. This patch even made it worse on my test. Some POI got dropped that were displayed before. The overview map (as can be seen here) is shifted about 1.5km to the east.
I have a testmap that you can download here and try around to see if you get it right. (have a look at it with JOSM to check that no objects near the tile border are dropped). The testmap can be downloaded from here: http://openmtbmap.x-nation.de/maps/legend.zip

Felix,
Nope, still broken. This patch even made it worse on my test. Some POI got dropped that were displayed before. The overview map (as can be seen here) is shifted about 1.5km to the east.
Your picture only shows 1 tile. You have to have a tile on both sides of the boundary. Please look at where two tiles meet and see if the mouse works right up to the boundary on either side. Mark

On 18.01.2010 10:35, Mark Burton wrote:
Felix,
Nope, still broken. This patch even made it worse on my test. Some POI got dropped that were displayed before. The overview map (as can be seen here) is shifted about 1.5km to the east.
Your picture only shows 1 tile. You have to have a tile on both sides of the boundary. Please look at where two tiles meet and see if the mouse works right up to the boundary on either side.
Okay, on maps in the northern hemisphere without patch no problem. In maps of the southern hemisphere with and without patch I loose the tooltip for a small stretch.
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Felix,
Okay, on maps in the northern hemisphere without patch no problem. In maps of the southern hemisphere with and without patch I loose the tooltip for a small stretch.
OK, thanks. That's quite different from what I get here on my GB map and the Baltic map. On those, without the patch the mouse doesn't work close to one side of a vert or horiz boundary and with the patch it works right up to both sides of all boundaries except the S and E edges of the outside tiles (and they would be OK too if the splitter had rounded the tiles in a similar fashion to how the patch does it). Think I'll just keep this patch as a local tweak and not commit it. Mark

On 18.01.2010 12:06, Mark Burton wrote:
Hi Felix,
Okay, on maps in the northern hemisphere without patch no problem. In maps of the southern hemisphere with and without patch I loose the tooltip for a small stretch.
OK, thanks.
That's quite different from what I get here on my GB map and the Baltic map. On those, without the patch the mouse doesn't work close to one side of a vert or horiz boundary and with the patch it works right up to both sides of all boundaries except the S and E edges of the outside tiles (and they would be OK too if the splitter had rounded the tiles in a similar fashion to how the patch does it).
Think I'll just keep this patch as a local tweak and not commit it.
Feel free to commit it if you think it makes sense. I had no regression either. Maybe it would be best to find out why the overview map does not fit if created with mkgmap. If I use maptk it fits 100%.
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 18.01.2010 15:44, Mark Burton wrote:
Felix,
Maybe it would be best to find out why the overview map does not fit if created with mkgmap. If I use maptk it fits 100%.
What resolution is the overview map created by maptk? mkgmap uses 13.
Mark
For my maps, I have lowest resolution 17 via style-file. Gmaptool/maptk then creates an overview map with resolution 16 (inclues one point) and 14 (empty). I have uploaded here the map including gmatpool / maptk overview map (the overview map is written by gmaptool, and compiled with maptk).: http://openmtbmap.x-nation.de/maps/beta/mtblegendoverviewmap.zip Probably the problem is that the overview map has to be one level below the last level in your map. So if in style-file/options resolution 16 is the last level, then overview map has to be created at 15/13. It would be great if mkgmap would however use the lowest level not in normal maps, but divert into the overview map. So if resolution 16 is the last level in the style-file, the content would be written to 16, and an empty level created at 14.

[duplicate message, original got lost?] Hi Felix,
Okay, on maps in the northern hemisphere without patch no problem. In maps of the southern hemisphere with and without patch I loose the tooltip for a small stretch.
OK, thanks. That's quite different from what I get here on my GB map and the Baltic map. On those, without the patch the mouse doesn't work close to one side of a vert or horiz boundary and with the patch it works right up to both sides of all boundaries except the S and E edges of the outside tiles (and they would be OK too if the splitter had rounded the tiles in a similar fashion to how the patch does it). Think I'll just keep this patch as a local tweak and not commit it. Mark

On 18.01.2010 12:37, Mark Burton wrote:
[duplicate message, original got lost?]
Hi Felix,
Okay, on maps in the northern hemisphere without patch no problem. In maps of the southern hemisphere with and without patch I loose the tooltip for a small stretch.
OK, thanks.
That's quite different from what I get here on my GB map and the Baltic map. On those, without the patch the mouse doesn't work close to one side of a vert or horiz boundary and with the patch it works right up to both sides of all boundaries except the S and E edges of the outside tiles (and they would be OK too if the splitter had rounded the tiles in a similar fashion to how the patch does it).
Think I'll just keep this patch as a local tweak and not commit it.
Well I had no regressions either. So feel free to commit it.
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Apart from Felix's report, I have seen no other comments about this patch so I shall commit it unless anyone reports any problems with it in the next day or so. Mark

On 25.01.2010 16:34, Mark Burton wrote:
Apart from Felix's report, I have seen no other comments about this patch so I shall commit it unless anyone reports any problems with it in the next day or so.
Mark
Could you try to find out what goes wrong in my map? The very small osm file is here (style and levels don't seem to matter): http://openmtbmap.x-nation.de/maps/legend.zip
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix,
Could you try to find out what goes wrong in my map? The very small osm file is here (style and levels don't seem to matter): http://openmtbmap.x-nation.de/maps/legend.zip
What's going wrong? I tried making it with my default style and could see various lines/area/pois OK. Mark

Felix, If you're referring to the fact that the overview map does not match the bounding box of the map itself, that's because the tile's bounds are not rounded in the same way as the overview bounding box (lons rounded down, lats rounded up (at zoom level 13?)) Mark

On 25.01.2010 17:11, Mark Burton wrote:
Felix,
If you're referring to the fact that the overview map does not match the bounding box of the map itself, that's because the tile's bounds are not rounded in the same way as the overview bounding box (lons rounded down, lats rounded up (at zoom level 13?))
Well that is exactly what I was referring to. The problem is that if I place POI at the very left, they are not visible in Mapsource (when zooming in). Maybe the overview map should be rounded to be bigger than the tile below? Some time ago (about 6 month) in the east of Austria Geofabrik cuts, it happened that some part of the map got dropped. Since quite a few time I could not find such problems anymore with real osm data, only with my "testmap". The thing is, that gmaptool to create mp, and maptk to compile it, get the rounding right (or so much better that no more error is visible).
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix,
If you're referring to the fact that the overview map does not match the bounding box of the map itself, that's because the tile's bounds are not rounded in the same way as the overview bounding box (lons rounded down, lats rounded up (at zoom level 13?))
Well that is exactly what I was referring to. The problem is that if I place POI at the very left, they are not visible in Mapsource (when zooming in). Maybe the overview map should be rounded to be bigger than the tile below?
No, I don't believe so. Making the overview map big is what we do now (round out in both lat and lon) but I believe that's wrong because if you round like that, all the overview map rectangles get bigger and then they overlap which (I believe) is what causes the mousing to fail in mapsource. I currently think that both the map boundaries (as set by splitter or bounds element) and the overview map bounding box have to be rounded the same as I am trying to do with this patch (lons rounded down, lats up).
Some time ago (about 6 month) in the east of Austria Geofabrik cuts, it happened that some part of the map got dropped. Since quite a few time I could not find such problems anymore with real osm data, only with my "testmap". The thing is, that gmaptool to create mp, and maptk to compile it, get the rounding right (or so much better that no more error is visible).
Yes, but what's the resolution of that overview map? We currently use 13 (I think) but it doesn't have to be so low (just lower than the resolution of the tiles). Mark

On 25.01.2010 20:43, Mark Burton wrote:
Felix,
If you're referring to the fact that the overview map does not match the bounding box of the map itself, that's because the tile's bounds are not rounded in the same way as the overview bounding box (lons rounded down, lats rounded up (at zoom level 13?))
Well that is exactly what I was referring to. The problem is that if I place POI at the very left, they are not visible in Mapsource (when zooming in). Maybe the overview map should be rounded to be bigger than the tile below?
No, I don't believe so. Making the overview map big is what we do now (round out in both lat and lon) but I believe that's wrong because if you round like that, all the overview map rectangles get bigger and then they overlap which (I believe) is what causes the mousing to fail in mapsource. I currently think that both the map boundaries (as set by splitter or bounds element) and the overview map bounding box have to be rounded the same as I am trying to do with this patch (lons rounded down, lats up).
Some time ago (about 6 month) in the east of Austria Geofabrik cuts, it happened that some part of the map got dropped. Since quite a few time I could not find such problems anymore with real osm data, only with my "testmap". The thing is, that gmaptool to create mp, and maptk to compile it, get the rounding right (or so much better that no more error is visible).
Yes, but what's the resolution of that overview map? We currently use 13 (I think) but it doesn't have to be so low (just lower than the resolution of the tiles).
13/12. And my map ends at 17. I just changed for 15, then 13 fits well. With map ending at 17 and overview map being 13 it is not ideal. maptk/gmaptool use 2 lower, meaning 15/13 in case lowest map level is 17, or 14/12 if maps has last objects in 16. Well in general I think we need a non empty background map anyhow, because with the basemap on GPS resolutions 17 and lower make not much sense, and in Mapsource 6.13 it is much faster (one file instead of seeking through all). Also for QlandkarteGT non empty overview maps would be much faster. Once overview map is not empty, those problems should be gone anyhow.
Mark _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (2)
-
Felix Hartmann
-
Mark Burton