Overview of Total Work Done
- Brushing of C++
- Compiled the MapServer code on Linux and Windows from source.
- Explored the MapServer functionality and codebase through the documentation.
- Read up about SVG syntax, parsing and rendering.
- Researched on various non-intrusive open source graphics libraries that support SVG (Libsvg-cairo, cairo, Librsvg and AGG(Anti-Grain Geometry)). The research involved finding the dependencies, functionalities, integratability and ease of use of each library. AGG was decided for in the end as it had already been integrated into the MapServer codebase in the past. Libsvg-cairo, cairo and Librsvg were pushed aside due to their large number of dependencies and for the added task of having to integrate them into the MapServer codebase unlike AGG.
- Understood, modified and added the SVG parser example from the AGG codebase into the MapServer codebase. The modifications included changing the namespaces from agg:: to mapserver::. The research included finding the subset of the SVG specification that was supported by the AGG SVG Parser example. It also included understanding the various functionaities provided by the parser and renderer. The modified code is stored at a project specific sandbox that can be viewed here
- Wrote an RFC on the entire process of adding SVG symbol support to MapServer. The SVG details the various design decisions that were taken. The RFC can be accessed here.
- Started working on getting SVG rendering support into MapServer. This was done through the following steps:
- Modified the MapServer lexical analyzer (in maplexer.l) and added the required new keywords ('SVG' for the new type and 'SVGPATH' for the path to the SVG image).
- Modified the MapServer mapfile parser (in mapsymbol.c and mapsymbol.h) and added parsing support for identifying and getting information about the SVG type.
- Created a new bridge file (mapsymbolsvg.cpp and mapsymbolsvg.h) to integrate the SVG parser and the MapServer C code. Began the function createBrushFromSVG's implementation in the new file. This function returns a gdImagePtr (for now, we concentrate on rendering with the GD renderer) from the specified SVG file by first rendering it to an AGG pixmap and then converting it to a GD pixmap.
- Modified the various rendering functions in mapgd.c to use the new createBrushFromSVG function when a SVG symbol is found in the symbolset. Currently createBrushFromSVG is still not fully implemented and tested.
Work to Do Next Week
Although the official pencils down date is 17th, August, I will continue to do the following in the next week to complete the project successfully.
- I will be working on completely implementing and testing the createBrushFromSVG function and any remaining glue code.
- Currently all the work involves getting SVG symbols to render with the GD renderer. Once that is completed, I will move onto getting it to render with the AGG renderer.
- Any currently unforseen changes to the RFC will be made and some of the remaining documentation will be prepared (eg. the subset of the SVG specification supported by MapServer).
Working with MapServer over the summer has been an amazing experience for me. I got to know some wonderful people in the process and, being my first foray into the world of open source development, taught me a lot about how things go on under the hood! I also learned a lot from my mentor (Daniel Morissette), who has been extremely supportive and encouraging right from the beginning. I am also extremely thankful to the other developers on the mailing list and IRC channel who helped me out in many corners constantly. I would love to continue to work along with this community in the near future and take up further MapServer projects.
- Code Sandbox : http://svn.osgeo.org/mapserver/sandbox/svgsymbols/
- Project Wiki : http://trac.osgeo.org/mapserver/wiki/GSoC_SVG_Symbols
- RFC Document : http://trac.osgeo.org/mapserver/wiki/GSoC_SVG_Symbols_SECOND_DRAFT_OF_THE_MS_RFC