: a SVG Generator for Animated Maps Laurent PIERRE EDF R&D laurent.pierre@edf.fr
Presentation Electricité De France ( EDF) is the historical french electricity utility. EDF R&D (2000 ind) is a mutualized entity for all the EDF Group. ICAME (our department) deals mostly with commercial entities of the EDF group. I mostly work to bring web mapping to projects, essentialy with FOSS4G tools.
Location
Location
Plan The context First attempt the future
The Context
Context & Needs At the very beginning we were asked to find a way to visualize time varying data with thematic maps. All the products we knew were unable to take the 'time part' into account. So we decided to investigate to find methods to achieve the requirements.
Data We were provided with spreadsheet data from marketing division. As a first example, these data simulate client behavior for the next decade. They also have an attribute referencing a map ID (administrative region id).
The data
The data space time data data
The data space time data data selectors
The data a join between a data and a map having... at one time, one place with the selectors set each to a value we must have at most one line matching. we can formally construct an 'animation' along the timeline. now, one must find a practical way to generate the actual animation.
Constraints Besides being a tool for marketer, the product had to be able to produce material for presentations (to suits). The tool had to be accessible to non cartography specialists. End users must be able to define by themselves the data and the map to be used as well as the thematic.
First Attempt
Limited Goals We didnt'get at once to the desired result... At the begining, we wanted to show that animated thematic maps were valuable as a demonstration tool. Our fisrt attempt didn't emphasize on data and animation definition but on showable results.
Techniques Let's recall that a movie is composed from still images at the rate of 24 per second. If we can produce thematic maps based on user data for each slice of time (with interpolation between the actual values). Then we can assemble these images to produce a sequence.
Tools Used Mapserver for elementary image (map) generation. ImageMagick for image assembling and legend creation. PostgreSQL for data and map storing. Quicktime Pro for film generation from elementary images.
First Generation python mapserver QuickTime postgresql
Demo 1
Toward Nice demo but.. huge data volume for a movie (~70 M). no interactivity with animations. complex process for creating animations : definitly not for end users
Toward We came up with vector animation : SVG Flash and proposed a web interface for user interaction.
SVG SVG (Scalable Vector Graphic) is a XML dialect dedicated to vector graphic description Besides, a SVG description can be embedded in a HTML file and manipulated through DOM description via javascript. It is an open format easy to produce and transform
SVG In SVG language, one can assign color to geometric elements. Color changes can even managed by the language. Instead, we choosed to use javascript to apply to each geometric element a color function of the time (better flexibility).
SVG
SVG
SVG One can easily assemble independently generated SVG fragments to form a final animation without any new calculation. Thanks to vector format, animations produced with SVG format are visible in all sizes. Graphical effects (shadows, gradients) are easily produced. Tooltips are possible within an animation.
Data, Animations & Movies Data Maps Animations geo id's must match 1 or 2 value(s) chosen selectors affected Movies time must be common
Demo 2
How Does it Work? Data and meta-data are stored in a database (PostgreSQL). XML representation for meta-data. Extensive use of patterns for SVG generation. Python (and Turbogears soon). Maps are stored in the database as SVG fragments and referenced in the XML representation with their meta-data associated (extents, gid,... ).
The Future
The Future Choices in thematic styles are reduced. Ergonomy could be better. We must have the ability to add extra maps just to improve presentation (roads, rivers,...) Why not use symbolic maps for none spatiallly referenced data?
The Dark Side of the Future we love SVG but it is hard to make it run on all platform with any browser we use IE6 + Adobe SVG viewer (dark future) on Windows on OS X it works thanks to Crossover We hope that SVG will be more supported by Firefox, Safari and Opera
The Future But if not? Flash runs everywhere proprietary format Java client robust libraries UDIG? ETL needed to nicely import data.
Open Source We are looking for people interested in the project in order to share our experience In the near future, we would like to impulse a GPL project for.
Questions?