Playing with Google Earth

Tuesday February 10, 2009

Now that Google Earth has some love for us oceanographers, I started working again on my Opendap—Google Earth bridge (a KML response for Pydap). I started by rewriting the WMS response, responsible for creating two-dimensional maps of the data served by Pydap. The new WMS response now uses Matplotlib for plotting, which made the code much more simple and faster — in the old response I was creating maps from scratch, normalizing the data and then plotting using PIL!

The first thing I added to the KML response was a colorbar for the data being visualized. Here’s an example where you can see the colorbar on the lower left side of the screen (note the transparency effect, ooohh):

Screenshot from Google Earth showing data from a Pydap server.

To my surprise I didn’t need to use the Basemap toolkit from Matplotlib to get the projection right. I just plot the data using a regular grid and it seems that GE does the rest for me, which is great. I’m always scared by the name EPSG:4326 and other GIS terminology.

A nice thing is that the code is smart enough to retrieve only the data for the area being visualized. This mean that if you zoom into a region, the image will be built reading only data for that region, in order to minimize disk/network access. If the data has a high resolution it will also be subsampled at the optimal resolution, depending on the image size.

Now I want to implement animations when the data has a time axis. Right now the server simply makes a time (or level) average, compacting the data to two dimensions. It would also be nice to plot the layers on the corresponding altitude — or depth.

Roberto De Almeida

,

---

Comment

  1. sensacional.

    rafa · Feb 13, 03:36 AM · #

Commenting is closed for this article.

---