[mapserver-dev] A Question

Stephen Woodbridge woodbri at swoodbridge.com
Sun Jul 12 10:53:48 EDT 2009


kiran varma wrote:
> In the IRC that took place on the 8th July, 2009 
> (http://logs.qgis.org/mapserver/%23mapserver.2009-07-08.log), tbonfort 
> mentioned that we would need to create a special cache to hold SVG 
> symbols based on their size and orientation. I am having trouble 
> grasping the need for such a cache. Would it be possible for someone to 
> elaborate on it a little?
> 
> So far, what I have understood of the overall proposed solution is the 
> following:
> 
> 1. Trigger the SVG parser and renderer according to
>         SYMBOL
>                 TYPE VECTOR
>                 FILE "/path/to/file.svg"
>         END
> 2. On triggering, generate a pixmap of the SVG file and store it in 
> cache to prevent having to rasterize it every time. Keep this step in a 
> single function to allow for using different rendering libraries later 
> on. Parsing is done throught the svg_viewer example provided in the AGG 
> sources.
> 3. Render the pixmap using a rendering library (such as AGG or GD).
> 
> Why is there a need to have a cache for SVG symbols based on size and 
> orientation?

I'm assuming that this is because each size and orientation will 
generate a different pixmap image. And while it might be possible to 
rotate and scale an image, I think that this would generate a less than 
desirable end result.

If you first rendered an svg image very small and cached that, then 
later needed a larger version of it, scaling it larger would become 
pixelated, but if you rerendered it larger then that would look better. 
Also since these might be rendered with antialiasing, that might not 
scale or rotate nicely either.

-Steve W


More information about the mapserver-dev mailing list