Google Maps Offline Library: Changed name to Offline Maps and added Elevation tiles

Have a look at the follow-up article posted here.

I’ve added a new Tile type to my library: an Elevation tile which shows the elevation contour plot of a corresponding Google Maps tile.

I first got the idea when using the Gmap Pedometer website to construct a cycling tour near the place we llive. The website uses a webservice located here to query for the elevation at a certain longitude and lattitude. In the website it is calculated for the points clicked.

What I wanted was a contour plot of the elevations in a Google Maps tile. You’ll have to experiment somewhat with the settings because I’ve noticed that if you set the probing grid to close you don’t get nice continuous plots but rather jagged contours as you can see in following pictures:

Using a gridspacing of 10 pixels at zoomlevel 15:
Elevation Gridspacing 10px

Using a gridspacing of 50 pixels at zoomlevel 15:
Elevation Gridspacing 50px

As you can see for yourself you get much smoother lines in the last picture. The explanation of this is simple: it depends on the probing grid at which the elevation data was captured that is fed to you by the webservice. If you are querying the elevation webservice at points in between the probing grid of it’s data, you can not enhance the resolution of the tile.

Hope you enjoy the code.

Oh yeah: still no documentation or much error handling.

The Code

[1] Bilinear interpolation
[2] Writing XML Documents
[3] Gmap pedometer

25 october 2007: Original article.
19 november 2007: Added link to follow-up article.


Google Maps Offline Library

I’ve extended the library with a new tile, see this post. The link to the code provided in this post is no longer valid.

We all have used Google maps but unfortunately you can only use it when you are online. What I wanted was to have the maps of an area available offline so I can take them with me.

My first idea was to somehow have an Internet Explorer plugin which would allow me to go to google maps and then download all the images shown onto my harddisk. During my research for writing this plugin I came across this article which analyses the url’s used by google maps. That was exactly what I needed.

So I wrapped the code of the article in a small library, added some more functionality as requested by some people, like him and him, that I can also use in my future application and now you can download that code here.

I will post updates as the project evolves. There is no error handling or documentation yet but I will add all this in the future, but for now this is it.

Hope you enjoy it.

14 october 2007: Original article,
17 october 2007: Reposted the code after someone noted errors.
21 october 2007: Changed title to more precisely reflect the intention of the article/code.
25 october 2007: Updated to forward to this follow up post