Sunday, June 5, 2011

Second week of GSoC

The main task during this week was to implement the 'Visualization of GIS data' functionality. I had a clear understanding on the functionality and the basic structure for the new class hierarchy as I did some work on the same area to provide a proof of concept prior to GSoC. 

Initially I tried to use flot library for visualizations, for rich functionality it offered, such as zooming and panning, but later realized that using a charting library for this purpose is not suitable. My requirement was to draw basic shapes which charting libraries did not support. So I used SVG to generate the visualizations.

I could use SVG transforms (scale and translate) to support zooming and panning. To manipulate the SVGs I used jQuery SVG, which gave me control over SVG elements. Now double-clicking on the plot zooms it while clicking on the directional arrows on the top right corner pans the plot. Additionally I used jQuery mouse wheel plugin to capture the movement of mousewheel which was then connected to the zooming functionality. Now you can zoom the plot using the mousewheel. Further I used jQuery drag plugin to capture dragging on the plot and now the panning happens when the dragging is performed on the plot. Adding tooltips to visualizations was trivial. So by now I have supplied almost all the rich features flot offered using SVG and a set of jQuery plugins.

One problem with SVG was that versions <= 8 of IE do not support it. Since IE is still the major browser (atleast among non-IT related users) I tried to provide atleast a basic solution to those users. I used GD library to generate the same visualization in PNG format for IE users. 

Since I was looking into generating PNGs I also had a look at 'Exporting visualizations into various formats' feature, even though it was alloted a later time slot in the schedule. Now the visualizations can be exported to SVG, PNG and PDF formats. IMO there needs to be some improvements to this funcionality, but I would like to take them during the allocated time slot. I completed visualizing of GIS data with SVG around a week before its deadline by putting some extra effort, to save some time for the next feature, which might take more time than anticipated. So during the next couple of weeks I will be trying to connect the visualization functionality with OpenStreetMaps to give a better visualization for those data that are related to earth's geometry.

No comments:

Post a Comment