Menu

CacheCreator

Anonymous Kempelen

Introduction

Several people have asked about whether it is possible to download map images to a pc and transfer them to the phone, so as to save on the cost of mobile data charges.

I've written a small j2se app that creates the necessary cache file for MTE and, used in conjunction with some other software it is now possible to create maps 'offline'.

What follows is a guide on how to create the map cache file.

Overview

Mobile Trail Explorer (MTE) has a feature that enables map images to be displayed in the background behind the trail. This feature is enabled within MTE by clicking Settings->Display->Scroll to 'Map Display' and select one of the 'Draw __ Maps' options.

With the option enabled MTE will access one of several map provider services and download the map images (tiles) around the area of the current GPS position, and display them on the screen. The map images are also stored in a cache file so that they do not get downloaded again unnecessarily. The cache file is called 'MTEFileCache' and is created in the Export folder (where trail kml/gpx files are stored).

The Problem(s)

  • Mobile data plans vary in cost across the world from being free to being very expensive indeed.
  • You may wish to use maps in an area where there is no mobile coverage at all.

The Solution

Why not download the required map images on your pc before you set off, convert them into the format required by MTE, then transfer them to the phone?

Cache Creator

Enter Cache Creator, a desktop utility that converts map images into a cache file usable by MTE.

What you need

  • A pc with Java installed, 1.5+ will be ok
  • The ability to copy files to a specific directory on your phone. If you can connect your phone to your pc via usb and use it as a flash disk, you can already do this.
  • CacheCreator. The compiled jar file is in the dist directory.
  • Some application that can download map images from the internet. I suggest JTileDownloader for 2 reasons: it works and it's the only one I've tested this application with.

How to Use

  • First you need to get some map images onto your pc. Use JTileDownloader to download a bunch of tiles around the area of interest.

Don't download too many tiles as currently MTE has to parse all of them on startup, and your phone may run out of memory.

  • Run Cache Creator from a command prompt like this:

java -jar CacheCreator.jar osmmaps c:\tiles\

Where 'c:\tiles' is the directory where JTileDownloader put the downloaded tiles.

and 'osmmaps' is a key corresponding to the map type supported by MTE. Currently you can use 'osmmaps' or 'tahmaps' here. These strings map to the 'Display Map' options in the MTE settings, so If you use 'osmmaps' here make sure you also select 'Draw OSM maps' to see the map tiles.

  • Assuming all goes well, this will create a MTEFileCache file in the c:\tiles directory.
  • Copy this file to the export directory specified in MTE Settings->Export Folder
  • Restart MTE; the cache file will be parsed on startup and any displayable tiles will be shown.

Note

If a cache file already exists, Cache Creator will add any new tiles to it.

Limitations

Only png images are supported. The images must be 256256 pixels. Cache Creator requires* the folder structure is of the format zoomlevel/latitude/longitude.png. (JTileDownloader outputs images like this.)

To do

Integrate this into the MTE svn repository. (Not sure if this is possible, netBeans complained when I tried)


Related

Wiki: Home

Discussion

  • Anonymous

    Anonymous - 2008-12-06

    Originally posted by: francisc...@gmail.com

    Hi,

    when will be a MTE realease which uses the file generated by CacheCreator?

    I am very interesting in MTE, i have downloaded the latest release. In a few days I am having a nokia 6110 navigator and want to use, even to upgrade with more features (first i must finish learning j2me), the MTE software.

    read you...

     
  • Anonymous

    Anonymous - 2008-12-27

    Originally posted by: francisc...@gmail.com

    I had not seen the cache file must be in export folder... now i have tested it in device the downloaded maps.

    I want now to include my own maps, but i do not see the relation between UTM or WGS84 coordinates and the ones downloaded using jtiledownloader, which it seems to be in pixels...

     
  • Anonymous

    Anonymous - 2009-01-04

    Originally posted by: gdjo...@gmail.com

    Can I suggest you take a look at http://cfis.savagexi.com/2006/05/03/google-maps-deconstructed? it explains the math behind the google maps system (which is the same as OSM)

     
  • Anonymous

    Anonymous - 2009-04-08

    Originally posted by: NilsWaus...@googlemail.com

    Hi,

    Where I have to place the png files on my phone? I have placed the MTEFileCache in the same directory where Mobile trail explorer created the file with the same name. I tried to import the png files from the same directory where the MTEFileCache is placed. After restarting MTE it didn't show any displayable tiles. I can't see the map offline.

     
  • Anonymous

    Anonymous - 2009-05-25

    Originally posted by: zbytov...@gmail.com

    Hello, could it be possible to use OziExplorer? atlases? The same is used by Trekbuddy and provided with great tools for exporting all kinds of maps - TrekBuddy Atlas Creator (screens).

    This MTE is really cool, how could i have lived without it :) Its a pity that trekbuddy is closed-source, otherwise merging these two software could be incredibly great. :) Btw: could use browse dialog when importing GPX files? thanks and keep up the great work!

     
  • Anonymous

    Anonymous - 2009-07-12

    Originally posted by: pochekay...@gmail.com

    I have a problem to load a map from Pc to cell phone.

    I did exactly like was written in this guide. After copying MTEFileCache to the phone and restarting MTE, no map is loaded. Can you please suggest something? My phone is SonyEricsson? M600i (symbian UIQ 3). Of course I selected Settings->Export Folder, my file MTEFileCache is for sure there.

    Thank you very much in advance for help

     
  • Anonymous

    Anonymous - 2009-07-19

    Originally posted by: andreas....@gmx.at

    I've created tah-map successfully. Due to a incompatibility btw. MTE and CacheCreator you can only use MTEFileCach with one zoom-level. I don't know if this problem is already solved. I've built my own MTE-version with a small correction, which solves this problem. See MTE issue 172. If you need further support, please continue on issue 172, there I can also attach files (MTEFileCache-example and track-example)

    BR, Andreas

     
  • Anonymous

    Anonymous - 2009-08-24

    Originally posted by: grop...@gmail.com

    Hello. As commented before, a program similar to JTileDownloader but actively developed, easier and (IMHO) more complete than JT is TrekBuddy Atlas Creator. With it you don't have to copy and paste an Openstreetmap permalink from the browser, you just select the area with the mouse, directly from the application. It also supports a lot of map sources (OpenStreetMap?, Yahoo, Google, Microsoft...).

    So, I've asked TrekBuddy? Atlas Creator developers if they could add the output format required by MTE and, just few hours later, MTE support was in SVN (many thanks to the devs!).

    I've created working MTE map caches from both Openstreetmap and Google Earth.

     
  • Anonymous

    Anonymous - 2009-10-21

    Originally posted by: arto.ke...@gmail.com

    Howto make MTEFileCache-file from TrekBuddy? Atlas Creator-files? There is now option (TrekBuddy? Atlas Creator) for Mobile Trail Explorer, but it just save folders with jpg images, not the MTEFileCache-file..

     
  • Anonymous

    Anonymous - 2009-10-21

    Originally posted by: arto.ke...@gmail.com

    Really.. it doesnt accept empty character in folder name, but TrekBuddy? Atlas Creator save images in folder like "Google Maps".. so it work's fine, if I change folder name to GoogleMaps?..

     
  • Anonymous

    Anonymous - 2009-11-30

    Originally posted by: rob...@mailueberfall.de

    If the MTE atlas output format of TrekBuddy? Atlas Creator doesn't work as expected just tell it to the developer - open a feature request:

    https://sourceforge.net/tracker/?group_id=238075&atid=1105497

    Describe in detail how an MTE-map/atlas should look alike and I am sure you will get it soon.

     
  • Anonymous

    Anonymous - 2009-11-30

    Originally posted by: rob...@mailueberfall.de

    Ok, just released a new version which is able to write MTECache directly. Please notes that this version is not able to update or extend an existing cache file:

    http://www.trekbuddy.net/forum/viewtopic.php?t=3755&postdays=0&postorder=asc&start=58

     
  • Anonymous

    Anonymous - 2010-06-30

    Originally posted by: jose1...@gmail.com

    is the mtecache option in mobac working for anyone? i only get some error (loading cache failed) and nothing's displayed. tried tah, osm and swiss local as a map source - no change

     

Log in to post a comment.

MongoDB Logo MongoDB