[mkgmap-dev] [PATCH] route recalculation sensitivity
From Alexander Atanasov aatanasov at gmail.com on Wed Apr 1 12:30:17 BST 2009
Hi, On Tue, Mar 31, 2009 at 5:58 PM, Steve Hosgood <steve at tallyho.bc.nu> wrote: > Bernhard Heibler wrote: >> I think I found the required bits. Seems to be the flag at 0x43 in the >> TRE header. Patch is attached. > >> + writer.putInt(0x110301); // Was 0xd0401 before. 31.03.2009 Changed to 0x110301 to increase route recalculation speed >> > > Judging by the source code and the "documentation", the use of this word > starting at 0x43 isn't yet known, and it does look as if the two > low-order bytes here haven't changed much. > > *If* the important part of this patch is to change the value of byte > 0x45 from 0x0D to 0x11 then we might postulate that the "recalculate > distance" is actually "EarthPerimeter/(12 * pow(2, n))" where 'n' is > that byte. (The '12' is just a fiddle-factor here). > > Assuming Earth's perimeter is 40Mm, that gives an original > recalculate-distance of about 406m (yeah - I can believe that) changing > to the new one of about 25m as claimed by Michel Marti. Internally of > course the recalculate "distance" will actually be in some fraction of > degrees or radians - probably in "Map Units" in practice. > > Again - assuming the 0x0D -> 0x11 change is the important bit, it leaves > the interesting question of what the other bytes do. It will be easy > experimentation to try other values of byte 0x45 to see if my postulated > relationship holds. Byte 0x44 changed from 0x04 to 0x03. What did *that* do? I'm trying to understand better zoom levels. On gmxt the lowest distance i've seen is 0.380meters on zoom 30m from the ground. (i'm courios what's on other devices) Which lead to one unit of garmin map scale is 2.28 meters. To get this from (1<<24) earth circumference comes as 38260 kilometers(i've searched for this number and closest i've found are related to earths magnetic field) earthcirc*1000/(1<<(0xd))= 4670.410156 meters earthcirc*1000/(1<<(0xd+0x4))= 291.900635 meters earthcirc*1000/(1<<(0x11))= 291.900635 meters earthcirc*1000/(1<<(0x11+0x3))= 36.487579 meters 0xd looks like a base bits and 0x4 like a detail bits, maps inherits basemap at 0xd bits and goes up to 0xd+0x4 bits. Which gives the most deailed resolution of the map, which is level 0. If this is the map resolution which would explain why this lives in TRE header. Roads are on level 0 and it makes sense to look for nearest road in the range of the level 0 resolution. And select other road only if the last selected is out of that range. If that is true. For a map 20-24bits value of 0x1404 should trigger recalculation on earthcirc*1000/(1<<(0x14+0x4))= 2.280474 meters. -- have fun, alex
- Previous message: [mkgmap-dev] [PATCH] minor change to motorway exits
- Next message: [mkgmap-dev] cascading multipolygon relations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list