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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s