Changes between Initial Version and Version 1 of GSoC_SVG_Symbols_FIRST_DRAFT_OF_THE_MS-RFC


Ignore:
Timestamp:
Jul 12, 2009, 7:25:22 PM (15 years ago)
Author:
kiranvarma
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GSoC_SVG_Symbols_FIRST_DRAFT_OF_THE_MS-RFC

    v1 v1  
     1                                 
     2                                     ==  MS RFC - SVG Symbol Support with AGG ==
     3
     4                                          Kiran Anjaneya Varma Alluri
     5                                                July 12, 2009
     61     Overview.
     7   Popular tools such as Inkscape generate SVG graphics natively. So far MapServer has not supported
     8the SVG format, which leaves many users with the extra work of converting between formats. This
     9RFC aims to introduce support for SVG graphics as an alternate method to de
     10ne vector symbols in
     11the MapServer symbolset.
     122     Method.
     13The SVG parsing and rendering will be triggered by the following syntax:
     14     
     15{{{
     16SYMBOL
     17         TYPE VECTOR
     18         FILE / path / to / f i l e . svg
     19      END
     20}}}
     21
     22The choice for using a SYMBOL for the task is to allow for the reuse of the SVG symbol easily within
     23classes.
     243     Technical Overview
     25In order to support the SVG format, we make use of the AGG library. The reasons for going with the
     26AGG library are:
     27   1. It has already been integrated into MapServer. While other popular libraries, such as Cairo, can
     28      be used, they would require eort to integrate into MapServer and would further introduce many
     29      dependencies into the MapServer code.
     30   2. It is a very lightweight library and delivers performance equal to, and sometimes higher than
     31      other popular libraries.
     32
     33There are some disadvantages that emerge from using the AGG library. Foremost, the AGG library
     34has an incomplete SVG speci
     35cation. To avoid having to reimplement the missing subset of the
     36speci
     37cation (which would, without a doubt, be a non-trivial task, and would add to the complexity
     38of this RFC), we stick by the following techniques:
     39   
     40   1. A modular design is used, where the generation of the intermediate pixmap is done by a single
     41      function so that it can be easily modi
     42ed to adjust to a dierent library. Thus,using a pixmap
     43      will allow us to use any rendering library.
     44   2. The unimplemented subset of the SVG speci
     45cation is clearly provided to users in the documen-
     46      tation to prevent frustration on their side.
     47                                                   1
     48To implement this functionality, the following steps needs to be accomplished:
     49   
     50   1. Implement an SVG parser. For this, we directly make use of the SVG Viewer example provided
     51      along with the AGG sources.
     52   2. Write a single function to render a parsed SVG
     53le to a pixmap. The pixmap will be an inter-
     54      mediate form that can then be rendered. The pixmap will be stored in cache memory to prevent
     55      having to constantly be rasterized it every time a symbol is drawn.
     56   3. Render the pixmap into the
     57nal image
     58le. This will be done using a mixture of the AGG and
     59      GD libraries.
     60   4     Files Added
     61
     62Finally, the SVG parsing and pixmap generation functions will be stored in source
     63files stored at
     64
     65{{{
     66/ mapserver / r e n d e r e r s / agg / svg /
     67}}}
     68 
     69The
     70files within the above directory include the files for:
     71    • SVG Parsing
     72    • Trigger Function (based on Map
     73file syntax)
     74    • SVG to Pixmap generation
     75All
     76files are within the C++ 'mapserver' namespace.
     77
     785     Documentation
     79The following documentation needs to be prepared for this project:
     80   1. Missing SVG speci
     81cation document.
     82   2. Basic usage tutorial with examples.
     83
     84