Animate your maps with GeoServer Animator Tool

,
In this blog post we'd like to introduce you to a new GeoServer feature, the WMS animator.
The animator follows in the footsteps of the WMS reflector, allowing a client to build an animated map with a relatively compact syntax.

An animation is built as a set of frames, and each frame is a separate WMS GetMap call, similar to the others in the set, but with a different value in one of the parameters.
The animator allows you to specify the parameter that will vary and its value via the aparam and avalues request parameter.

For example, let's say we have a dataset with time support enabled, in particular a small set of blumarble images for the different months in the year. A call to get a continuously animated progression would look like:


The aparam in this request is the WMS time parameter, while the avalues list a number of possible times, in particular a few months of the year. Also notice the output format, asking for an animated GIF that loops continously. The result is as follows:


Time and elevation are obviously prime candidates to drive an animation, but in fact every WMS request parameter can be used to drive the animation.
For example, we could change the bounding box and have the map move:




The actual reason the animator was developed was to allow building animation of tuna catches by ocean area over different types of aggregation factors, that are passed down to a parametrized SQL view building all the little squares you see in the map.
Here is an example showing the evolution of catches of a particular tuna spieces over the years:

http://localhost:8080/geoserver/wms/animate?layers=UN_CONTINENT,GRID_G5,TUNA_YEARLY_CATCHES,FAO_MAJOR,UN_CONTINENT&
format=image/gif;subtype=animated&aparam=viewparams:YR_TA&avalues=1990,1991,1992,1993,1994,1995&
width=512&format_options=layout:message;gif_loop_continuosly:true&viewparams=CD_GEAR:801\,802\,803;FIC_ITEM:2496\,3296\,3305\,2498;QTR_TA:1\,2\,3\,4;OP:sum




As you can see some of the maps include the indication of the year in the lower left. This is a recent addition to the animator framework, it uses a text WMS decoration to embed in the image the current avalue. See the animator documentation for details on how this can be achieved.

At the time of writing the only possible output format is animated GIF, but other formats could be written and plugged in, for example AVI or Flash, and transition effects could be added too.
Interested? Let us know!

The GeoSolutions team,

11 commenti:

senthilruban said...

Great work Andrea...As Simone mentioned in one of the previous post comment. Now live shots...

How about GWC for these time and elevation support? It seems complicate as image based on request parameters and we may need to have separate caches for each parameters. is it correct?

Andrea Aime said...

Indeed there is no GWC support. Caching works best on the pretictable structure of a tile grid with known set of call parameters, this case is rather the opposite of the spectrum, dynamic to the maximum, this functinoality is often associated with GUIs that allow to choose a number of variables driving both the map and the animation.
That said, I guess under specific conditions it might make sense but... it would require some work in GWC to integrate this animation style with the tile cache

IORi said...

Hmm, animation by time is actually defined in the OGC WMS 1.3.0 Spec if you look close enough: You can give several time instances or time periods in format begin/end/resolution as values of "time" parameter.

Does GeoServer support this in addition to the prorietary aparameter/avalues parameters described in the post?

Also it would be really beneficial for many web animation clients if WMS servers would return animations as JSON array of time & URL pairs. This would allow clients to build a GUI component for the user to control the animation.

This technique is already used a lot in animation web clients, and it would be nice to see it adopted in WMS world also. There's nothing to in the WMS space that would prevent it, because one of the formats for WMS GetMap could well be application/json.

senthilruban said...

Actually GWC support more important for any production deployment. I would prefer GIF images based on BBox and time/elevation variable than animated gif. The prefered option would be client to control the animation play based on required time period. Openlayers and other frontend framework should able to support this new feature and allow user to see what wanted.
In my quick view on GWC, It should be simple change to support GWC with this addition fields(time/elevation) support.

Simone Giannecchini said...

Ciao Senthil,
in GWC there is basic support for catching TIME/ELEVATION dimensions from WMS. Moreover, there is also support for additional parameters as per CQL filters.

Simone Giannecchini said...

Ciao IORi,
yes, you can make a standard WMS request with multiple times and select image/gif;subtype=animated (going from memory here...) and get back an animated gif.

As of the animated javascript-friendly output, this is on the radar but it is not supported ATM.

Simone.

Riaan said...

In the documentation it says: "Could be anything from layers, cql_filter, bbox, style and so on." I got bbox to animate but struggling with layers. Would be great if you could post an example of how to animate over different layers.

Andrea Aime said...

@IORi
When time/elevation support was added on trunk we also added the machinery to build animations the standard way, but we did not have an animated output format to try it with.
When we did the animator the animated output format was added, but we did not check, there was a small bug preventing the two sides from talking each other, which I just fixed:
http://jira.codehaus.org/browse/GEOS-4897

@Riaan
Animation over different layers was not really supposed to work, but I've just make a few changes so that it works that too:
http://jira.codehaus.org/browse/GEOS-4896
See it in action here:
http://demo.geo-solutions.it/share/sf-animation.gif

Both changes have been just committed, you'll find them in nightly builds starting tomorrow:
http://gridlock.opengeo.org/geoserver/

Audrey said...

So, if I have understood what you have said in the latest comment (6 December 2011), the bug is resolved in itself or do we have to install some plugin?
Could you also give an URL example of the animating GetMap request over multiple layers please?

Andrea Aime said...

Here is an example building an animation while changing the layers.

Pay attention to two things:
- the layers parameter needs to be specified anyways, with the same number of layers as the animation
- the list of layers is comma separated just like the list of values, so the comma there needs to be escaped

http://localhost:8080/geoserver/wms/animate?LAYERS=sfdem,sf:roads&aparam=layers&styles=,&avalues=sfdem\,sf:roads,sfdem\,sf:streams,sfdem\,sf:archsites,sfdem\,sf:bugsites&format_options=gif_loop_continuosly:true

Audrey said...

Thank's for the help Andrea!

I just would like to specify that your URL is in part hidden.
I tried to animate multiple layers with the current version of Geoserver (2.1.3) and it actually works.
Great job!