views:

381

answers:

2

Got a question regarding overlays and timelines in Google Earth (or possibly other KML-friendly clients).

I have data for every minute of the day for a given day that represents a numeric value for various areas on the map, and I want to display that data in a manner that looks basically like a weather radar map. So, for each minute, I basically have a big list of lat/lon bounding boxes, each of which has an associated numeric value; the display would involve drawing a polygon over the bounded area, and the polygon's color would depend on that numeric value.

I can see many ways of doing this for a single moment in time; either build a PNG with something like ImageMagick for the entire map area and overlay the bitmap, or draw the polygons directly on the map... the question, though, is how I can set this up so a time range can be selected by the user, and all the overlays which fit within that time range will all be displayed. And it has to be as responsive as possible, so efficiency is key.

It would be possible to pre-render lots and lots of PNG files, one for each time slice, for example; or would it be better to use polygons, or ... ?

Finally - is Google Earth the best client for this? Or would I maybe be better off with something else?

Thanks!!

+2  A: 

The Open Geospatial Consortium WMS standard for serving maps defines support for a TIME parameter, which allows support for temporal requests. WMS services providing this support are known as WMS-T. As far as I know, of the Open Source map servers only Mapserver and partially Geoserver provide support for WMS-T (I may be very wrong with this, as I speak only from personal experience). Check this page to get all the details on setting up a WMS-T service:

http://mapserver.org/ogc/wms_time.html

You can easily see how the request work having a look at this URLs:

http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?LAYERS=nexrad-n0r-wmst&TRANSPARENT=true&FORMAT=image%2Fpng&TIME=2005-08-29T13%3A00%3A00Z&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-90,22.5,-67.5,45&WIDTH=256&HEIGHT=256

Note how the TIME parameter changes from 2005-08-29T13%3A00%3A00Z to 2005-08-30T13%3A00%3A00Z (Times are formatted according to the ISO 8601 specification).

http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?LAYERS=nexrad-n0r-wmst&TRANSPARENT=true&FORMAT=image%2Fpng&TIME=2005-08-30T13%3A00%3A00Z&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-90,22.5,-67.5,45&WIDTH=256&HEIGHT=256

On the client side, although Google Earth can act as WMS client I don't think it supports temporal dimension on WMS requests. On the other hand, building a web client that supports them is really easy with OpenLayers, an open source Javascript web mapping framework, as you can see in the following example:

http://dev.openlayers.org/releases/OpenLayers-2.8/examples/wmst.html

Hope this give you some clues.


Edit: You can define multiple time values, a single range or multiple ranges. For instance, for a single range the URL will be:

http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?LAYERS=nexrad-n0r-wmst&TRANSPARENT=true&FORMAT=image%2Fpng&TIME=2005-08-30T13%3A00%3A00Z/2005-09-01T13%3A00%3A00Z&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-90,22.5,-67.5,45&WIDTH=256&HEIGHT=256

Note the TIME parameter being 2005-08-30T13%3A00%3A00Z/2005-09-01T13%3A00%3A00Z

amercader
This sounds like a definite possibility -- what do you know in terms of its speed and efficiency? Could it handle layers of, say, 1000 vector-based polygons? And is it possible to specify a time RANGE, as opposed to a single moment in time?
DanM
Check the edited answer for the RANGE support. As for performance, I have set up WMS services with MapServer reading shapefiles or PostGIS tables with thousands of features and the performace is great. You can definetely increase MapServer performance setting it up as FastCGI, especially if your data is in a PostGIS table. I have not personally used the temporal requests, but keep in mind that at the very end, this are filters applied to original dataset and that probably the more complex is the request (i.e. a time range vs a single moment), the more demanding it will be to render.
amercader
+1  A: 

The time features of KML are well documented and include time span. I would recommend that you try using both vector and image based methods depending on how close in the user is zoomed:

  • When the user is zoomed out (small scale) lots of cells will need to be drawn, making it more efficient to use an image. The PNGs could be packaged up in a kmz file, which is just a zipped directory.
  • When the user is zoomed in close (large scale) fewer cells will need to be drawn making vector the most efficient method. Google Earth can plot a large number of vectors, without much trouble but there are limits.

Google Earth is fantastic as a General Purpose viewer which is very very user friendly. However, the time series tools are more complicated so it will depend on the sophistication of your users. How applicable it is to your project depends on the type of data you have and the sort of output you want. You may get better results using flash.

Matthew Snape