Offline Maps formats


Hi I would like to introduce new feature of Locify application. The Offline maps. Almost everyone know, that Locify can show maps downloaded from web servers, I mean maps from different online providers like Google or Yahoo. This is nice, but it has a few negatives. It costs you money, you need phone signal and the speed of downloading is offen very sloooow. So we bring possibility to create and store your own maps and display them on map screen of Locify.

Firstly I have to tell something about Java limitations. Every Java software runs in another software called Virtual machine(on mobile phone called Midlet manager). This Virtual machine manage correct software running and also, what is important for us, says how much memory can running program consume. It's a big limitation on many device especially on Windows mobile. Together with limitation of maximum size of loading image (300 kb), we must be very careful. Take for example classic map tile of size 256x256x8b. It's size in memory is 65536b. Locify for classic mobile phone has set up memory limit for loaded images to 512kb (Windows mobile only 330kb). It means that you can hold maximum of 8 (5) images in memory at once.

From previous paragraph, it's obvious that you cannot load whole big map and hope that Locify can show it. You must your map image cut into small parts. But lets start with second part of these maps :).

Configuration file

Curently we support two types of configuration files. First is well-known OziExplorer map config file. Second then is easily-readed XML config file. So, Ozi map file has a very much parametres and configuration values, but not all are necesarry. Next paragraph show example of this file and show only needed parametres, not all availeable.

First possibility of Ozi map config file

OziExplorer Map Data File Version 2.2
map (map name)
map.png (map image name)
1 ,Map Code, 
Pulkovo 1942,WGS 84,   0.0000,   0.0000,WGS 84
Reserved 1
Reserved 2
Magnetic Variation,,,E
Map Projection,Transverse Mercator,PolyCal,No,AutoCalOnly,No,BSBUseWPX,No
Point01,xy,  158, 3285,in, deg,    ,        ,N,    ,        ,E, grid,   ,    3290839,    5633148,N
Point02,xy,15778, 3285,in, deg,    ,        ,N,    ,        ,E, grid,   ,    3415839,    5633148,N
Point03,xy,15778,12157,in, deg,    ,        ,N,    ,        ,E, grid,   ,    3415839,    5562148,N
Point04,xy,  158,12157,in, deg,    ,        ,N,    ,        ,E, grid,   ,    3290839,    5562148,N
Point05,xy,     ,     ,in, deg,    ,        ,N,    ,        ,E, grid,   ,           ,           ,N
Point06,xy,     ,     ,in, deg,    ,        ,N,    ,        ,E, grid,   ,           ,           ,N
Point07,xy,     ,     ,in, deg,    ,        ,N,    ,        ,E, grid,   ,           ,           ,N
IWH,Map Image Width/Height,16128,12288

Second possibility of Ozi map config file

OziExplorer Map Data File Version 2.2
map (map name)
map.png (map image name)
1 ,Map Code, 
Pulkovo 1942 (1),WGS 84,   0.0000,   0.0000,WGS 84
Reserved 1
Reserved 2
Magnetic Variation,,,E
Map Projection,Transverse Mercator,PolyCal,No,AutoCalOnly,No,BSBUseWPX,No
IWH,Map Image Width/Height,16128,12288

If config file will contain both Point and MM0 parametres, Locify will use Point ones (if contain 2 or more values). Maximum values of calibration points is not limited. For correct computing of calibration, Locify use Affine tranformation together with Least square method, so don't worry, calibration will be really precise.

Second type of config file - XML based

<?xml version="1.0"?>
	<description>my testing Prague map</description>
	<position x="0" y="0">
	<position x="5169" y="0">
	<position x="0" y="5365">
	<position x="5169" y="5365">

I think that XML config file is really brigth. Important is which posibilities you can use...

  • <projection> currently supported projection types - UTM, Pulkovo 42 (it's older Czech System-42 projection)
  • <position x=".." y="..">Definition of calibration points. Parametres x and y defines pixel coordinates on whole map image. If projection is simply in spheric coorinates (e.g. 49.1523, 14.5756) than use tags <lat>49.1523</lat><lon>14.5756</lon>. If coordinates are in flat map system use as you can see in example <X>...</X><Y>...</Y>.
  • <imageWidth><imageHeight> describe dimension of whole map image in pixels.

Map package

Currently Locify support two types of map distribution.

Uncompressed map package

That mean that in Locify/Map directory you'll have a config map file (for example 'Prague.xml' or '') and in the same directory ('Prague'), you have to have all map tiles. Name of this tiles have to be created from 3 numbers of X position, underscore and 3 numbers of Y position. So first image is 000_000.png. Second 000_001.png and so on... Other posibilites currently aren't supported.

Tar compressed map package

Locify fortunately support TAR compression, ofcourse with some limitations.

  • In TAR file, can be both types of configuration file, so XML or MAP configuration file type.
  • In TAR file, have to be one config file in root and one directory containing images.
  • For images, there is simple requirement. Their name have to and with X coordinate, underscore, and Y coordinate. It doesn't have to be only coordnates but i may be i order numbers too. Locify doesn't care about names of tiles, important are only those last numbers. Important is only that all files have to start with same prefix. So, for example, this is correct.
    as well as this:
    as well as this: