[mapserver-dev] SVG symbol support-MapServer

Daniel Morissette dmorissette at mapgears.com
Tue Jul 7 14:15:35 EDT 2009


I'd like to invite all interested parties (and hopefully at least the 
devs involved in the rendering parts of MapServer) to discuss this on 
the #mapserver IRC channel tomorrow (Wednesday) at 9:30am EDT:

http://timeanddate.com/worldclock/fixedtime.html?month=7&day=8&year=2009&hour=9&min=30&sec=0&p1=165

It seems to me that something based on libsvg-cairo is our best option 
so far... if it works. We would use libsvg-cairo to read and render the 
SVG symbols to a pixmap in memory using cairo and then the in-memory 
pixmap symbols would be pasted on top of the map as they are now. I have 
asked Kiran to make a test: write code to read and render a SVG symbol 
to a PNG output using libsvg-cairo and cairo to see what would be 
involved with that alternative. He should have some answers for us for 
the IRC meeting tomorrow.

Another (possibly more robust) alternative would be librsvg, it is 
apparently the de-facto SVG reading liib of the Cairo project 
(http://wiki.svg.org/Librsvg) but it seems to have lots of dependencies, 
at least that's what this Mapnik ticket seems to indicate:
http://trac.mapnik.org/ticket/320#comment:20

Unfortunately both libs seem to have kind of stalled in 2005:

- the latest version of libsvg-cairo dates from 2005 
http://cairographics.org/snapshots/libsvg-cairo-0.1.6.tar.gz

- the librsvg website (http://librsvg.sourceforge.net/) has not been 
updated since 2005 and I could not find any sign of activity around the 
project other than new releases of librsvg on the gnome FTP site 
(http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.26/)

Daniel

kiran varma wrote:
> Hi all,
> 
>  Here is a small summary of some of the options i have evaluated for my 
> project,* SVG support for MapServer ,i request comments and suggestions 
> on this topic!
> 
> Well,I have evaluated various options to handle SVG symbols some of them 
> are as follows..
> 
> --1. One thing is use a higher level SVG parser, that transforms the 
> input SVG into
> MapServer primitives. we should have to extend
> MapServer's rendering API to support more than lines, polygons and
> ellipses as it is now. (cubic, quadratic beziers, gradients,postgis curves
>  probably some more distorted figures).Implement a SVG subset that maps 
> to the existing MapServer rendering API..This feature not only solves 
> the present issue but also opens up support for some more!.Do a simple 
> additions to both Rendering API and also SVG parser
> 
> *libsvg-cairo will help us to explore without adding in too many
> dependencies.
> 
> --2. One approach might be to augment cairo to produce SVG output and then
> use cairo directly. I've been hoping to sit down and make an SVG
> backend for cairo at some point.But, there's still a need for a more 
> complete SVG rendering library
> that can target cairo. If we need to pick up libsvg development
> and run with it, that would be great.
> 
> 
> --3. This was a suggestion from a Developer >> use an out-of-the-box svg 
> to pixmap rasterizer, and create scaled
> and rotated pixmaps at a higher level before passing them over to
> mapserver's low level renderers. We would have to leverage a pixmap
> cache to do this, so as not to repeat the SVG parsing and rasterizing
> steps. A pixmap would be put in cache for each (scale,rotation)
> couple, or maybe only for each scale and rotate the created pixmap.
> 
> 
> 
> *I plan for option 1 as a good approach ,though it is a huge 
> process!!The last one was suggested by the Dev as a much easier approach 
> to complete the project .what do u say?
> 
> Any problems or errors in the approach please comment i will make sure 
> everything goes right on time.:)
> 
> thanks for your support
> Kiran
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the mapserver-dev mailing list