Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d299190328/htdocs/wordpress/wp-includes/post-template.php on line 275

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d299190328/htdocs/wordpress/wp-includes/post-template.php on line 275

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d299190328/htdocs/wordpress/wp-includes/post-template.php on line 275

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d299190328/htdocs/wordpress/wp-includes/post-template.php on line 275
Leon's Weblog

January 21, 2007

Maps for GPS Tuner

Filed under: Gadgets,Software Dev — Leon @ 10:34 pm

I have been looking for an off-road navigation solution when I stumbled across GPS Tuner. While TomTom is great for car navigation, it lacks many features such as track recording and support for custom maps. We now have the option of using the newly released mobile Google Maps and mobile Virtual Earth, these programs require a constant Internet connection and can be slow to use (especially when hiking in remote locations with poor cell phone reception). Its often much more convenient to have the needed maps pre-loaded and configured on the hand-held.

When I gave GPS Tuner a try I quickly realized that I have to spend a lot of time making my own maps. Luckily, there are a number of free online mapping systems (tile servers) such as Google Earth and Virtual Earth that can provide the base images for maps. The problem now is downloading the maps (in fine resolution) and piecing them together. Since I’m too lazy to do this manually, it was time for a little scripting to automate the process.

Google Maps and Microsoft Virtual Earth work by asynchronously downloading tiles of the map depending on the users desired map zoom level. With a little hacking, I figured that I could put together a script that will download any section of the map in any available zoom level and automatically put all the tiles together into one large image. The biggest challenge there is finding out the indexing scheme used for the tiles (i.e. given a lat/long coordinate and a zoom level deterministically determine the corresponding tile on the map and the URL to fetch that tile). The following articles on Via Virtual Earth gave me a great head start and even some sample code. All that was left to do is write a loop to download all the tiles between two lat/long coordinates and save them into one continuous image that can be loaded into GPS Tuner.

Here is the code and a sample image of Manhattan made from about 100 tiles.

Happy Navigating.

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/31/d299190328/htdocs/wordpress/wp-includes/class-wp-comment-query.php on line 405


  1. Hi there

    I really like this option to have the whole map tiled to make one big one, how do I use the code? I have install Google Earth and use Google maps.

    I am after maps for Hamilton NZ.


    Comment by Jace — August 4, 2007 @ 5:34 pm
  2. Jace,
    Unfortunaly, the code only works for the Northern Hemisphere (you need Visual Studio.Net to compile it). I recently found this out the hard way when I needed NZ maps for a trip. I didn’t have a chance to fix the script so I made the maps for GPS Tuner by pasting together screen-shots. It wasn’t that bad because most NZ cities are small. I don’t have a Hamilton map ready but, if you like, I can e-mail you Auckland, Christchurch, Havelock, Picton, Wellington, or a zoomed-out map of the entire country.

    Comment by leon — August 4, 2007 @ 6:06 pm
  3. That will be great as I am going to Auckland at the end of September. If you do have a chance to do a Hamilton map I would be so gratful as I have tried and it didn’t turn out that well…


    Comment by Jace — August 6, 2007 @ 4:40 am
  4. Hi Leon,

    Would it be possible to send me the maps of the cities that you have pieced together?

    Ive got tomtom navigator but they dont yet have any maps of NZ so this is really all ive got at this stage.

    Would appreciate if you could email it to me at my gmail address.


    Comment by Jeremy Wee — December 4, 2007 @ 6:43 pm
  5. your article is very interesting and useful for person like me who is interested in knowing how GPS maps is complied. Thank you.
    I use TomTom version 6 and I recently trying out “GPS tuner” on my Dell x51v and find out it is extremely intuitive and concur that getting maps made-up is tedious to say the least. Please send me you North America maps such that I may further realize the benefit of “GPS Tuner”.
    Do you have maps of cities in Western American region made? Perhaps cities of Washington states like Seattle and Vancouver-Canada?


    Comment by Henry Cheung — March 14, 2008 @ 3:55 pm
  6. Do you have a compiled version of the code that can be downloaded?

    Comment by Chris — April 18, 2008 @ 3:49 pm
  7. Dear Leon,

    I too, was excited to buy GPS Tuner for my x51v, however I found it much too involved for my attention span, and never got to creating and loading anything.

    A code savvy chap like you could make a few dollars, if you want to sell any of the maps you’ve created, especially of Los Angeles, and areas in Mid-coast to San Diego and Hawaii, since these are my sales territories.

    I am poised to buy a Garmin 360 device just to get on with it, but I still would like to get my money’s worth out of the x51v before I get an MWg Atom Life or similar device.

    I could put off both purchases or purchase neither, if you could steer me in the right direction, pun intended!

    Rhunsted Jordan
    Altadena, CA

    Comment by Rhunsted Jordan — May 15, 2008 @ 6:11 pm
  8. Rhunsted,
    I think the latest version of GPS Tuner solves most of the problems that I had with the system 18 months ago. You can now download the maps live on your PDA from several sources (including Google maps) and not have to worry about having all of the maps ready ahead of time. I’m not sure how well the maps are cached (in case you lose your internet connection). The new versions of the free Map calibrator that comes with GPS Tuner has also improved quite a bit making it easier to create your own maps.


    Comment by leon — May 15, 2008 @ 6:27 pm
  9. Leon,
    Does your code create the .GMI file with the co-ords in as well?

    Comment by Paul McGrath — August 19, 2008 @ 11:14 am
  10. Sorry for second post, also meant to ask. Do you know if the file limit for GPS Tuner is 1792×1792 which Map Calibrator makes? What max file size have you had on GPS Tuner?

    Comment by Paul McGrath — August 19, 2008 @ 11:16 am
  11. Paul, the code that I posted only generates an image (no calibration is done but that should not be too difficult to do since the image is generated based on GPS coordinates). The biggest image size that I used was 4781×4525; however, in practice, I found that using very large images made GPS Tuner work very slowly and made it harder to calibrate the maps accurately. The maps that worked best for me were ~ 1000×1000.


    Comment by leon — August 19, 2008 @ 4:01 pm
  12. Hi Leon,

    Can you convert your code into an application? Would really appreciate it.


    Comment by KoolPal — November 12, 2008 @ 9:14 am
  13. GPS is very useful specially the ones that are put on the Car dashboard. it can really help you drive on unfamiliar places.:*”

    Comment by Sophia Wilson — May 27, 2010 @ 8:07 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment