Forum: General Topics

Forums / General Topics / Just Curious...

 

Subject:Just Curious... 

ChrisM

11:41
Monday
28-Jul-2008

Location:
Bedfordshire, UK

Phone Model:
Sony Ericsson W770i, Blackberry Playbook(?)

Hi Stephen,

First of all, this isn't a request for you add anything else to your huge 'to-do' list... I'm just curious about how something works. If I were honest, it could lead on to some more work, but not right now! :-)

The .TMJ file format that you use for maps... In a very simplistic way, how do these work? I understand they are a bit like a .zip or .arc files, in that they contain a pile of individual map files, but is there also some sort of header with 'control' information as to what area the individual maps cover, their scale etc etc??

I was just wondering how difficult (if it's possible) it would be to combine 2 or more .TMJ files to produce one larger one.
What would happen if the areas covered by 2 the TMJ files were not adjacent, or if they overlapped.
What would happen if the two TMJ files contained maps of a different scale?
I guess the short answer to the above questions is 'It would probably bug*er things up', but if you could give me some idea as to how it would or wouldn't work I'd appreciate it!

I was just thinking about the situation where you needed lots of detail at each end of a journey, but less (or even none) in-between. I appreciate it could be done quite easily by manually selecting from two or three different maps(TMJ files), but was just wondering how practical it might be to do it all with a single TMJ file...

Chris.
 

Stephen

18:22
Monday
28-Jul-2008

Location:
Surrey, UK

Phone Model:
BB 9800 Torch
BlackBerry 8900
SE W910i
Nokia 5800

Hi Chris,

" First of all, this isn't a request for you add anything else to your huge 'to-do' list... "
Phew!! ;-)

The map files are pretty simple actually. As you guessed the header is used to tell TMJ what is contained in the rest of the file. A file can have any number of different map 'layers' which are in effect all totally independant maps - TMJ only loads one layer at a time, so it doesn't matter if they overlap or have different scales as they are never displayed together.

Each layer is simply a large rectanglar area defined by a lat/long bounding box, along with the number of tiles across and down (and the tiles pixel size). The header gives all these figures and then lists the file size of each individual tile. When loading the .tmj file initially TMJ reads the header and records the size of each tile in the file and can then calculate exactly which byte in the file a particular tile starts at, and how big it is (in bytes). (The header is plain-text so you can open a file in notepad to see an example). The tiles themselves are just bog-standard PNG or JPEG files - theres no need to compress these any further since these formats are already heavily compressed.

Theres no problem in combining several layers in a single file. Each layer is accessed in TMJ via the */# keys - mostly this will just jump between layers with different scales (giving the impression that you're zooming in/out), but theres nothing to stop a file having totally separate areas in it. Have you used the Map Merger utility (download it from the bottom of the MapOrganiser page) - this does pretty much everything you need in combining files.

Lets say you're driving from London to Edinburgh. TMJ should quite happily load a map with, say, one layer for central london at high detail, another for the M1 at lower detail, and then another for central Edinburgh at high detail again. As an added bonus when you use the */# keys to change layer TMJ will skip any layers which don't cover the current location, so this 3-layer file will appear to only ever have 1 or 2 layers depending if you're at the start or end points, or somewhere in the middle!

Hope that make sense!

Cheers,
Stephen
 
 

ChrisM

8:47
Tuesday
29-Jul-2008

Location:
Bedfordshire, UK

Phone Model:
Sony Ericsson W770i, Blackberry Playbook(?)

<PING!> (the sound of the idiot light on my forehead coming on again!)

Sorry, should have looked at the website more carefully. The MapMerge utility does exactly what I was trying to explain.

Once again, you're one step ahead of me!!

Cheers,

Chris.
 

(You must be logged in to post a reply to this thread)