Hi All,<div><br></div><div>Short version: it would be very helpful if MapServer&#39;s SVG symbol support could use librsvg as an option. See the conversation below for more information.</div><div><br></div><div>Comments welcome.</div>
<div><br></div><div>Regards,</div><div>Tom<br><br><div class="gmail_quote"><span style="font-size:large;font-weight:bold">Forwarded conversation</span><br>Subject: <b class="gmail_sendername">SVG symbol support in MapServer</b><br>
------------------------<br><br><span><font color="#888">From: <b>Tom Payne</b> <span dir="ltr">&lt;<a href="mailto:tom.payne@camptocamp.com" target="_blank">tom.payne@camptocamp.com</a>&gt;</span><br>
Date: 19 January 2012 11:12<br>To: <a href="mailto:zjames@dmsolutions.ca" target="_blank">zjames@dmsolutions.ca</a>, <a href="mailto:yassefa@dmsolutions.ca" target="_blank">yassefa@dmsolutions.ca</a><br>Cc: Alexandre Saunier &lt;<a href="mailto:alexandre.saunier@camptocamp.com" target="_blank">alexandre.saunier@camptocamp.com</a>&gt;, Emmanuel Belo &lt;<a href="mailto:emmanuel.belo@camptocamp.com" target="_blank">emmanuel.belo@camptocamp.com</a>&gt;, <a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a><br>

</font><br></span><br>Hi Zak and Yewondwossen,<br>
<br>
I&#39;m a geospatial/sysadmin at Camptocamp and have been trying to build<br>
MapServer with the SVG symbol support patch. We&#39;d like to test it.<br>
However, I&#39;ve run in to some problems compiling it. Could I pick your<br>
brains for a moment?<br>
<br>
We&#39;re primarily a Ubuntu/Debian Linux shop, and both Debian and Ubuntu<br>
provide packages for the Cairo graphics library, around version 1.8.10<br>
or so. As far as I can tell, the SVG support in MapServer is based on<br>
a library called libsvg-cairo, which was last updated in June 2005<br>
[1]. Unfortunately, this library is not available for Ubuntu/Debian,<br>
and it&#39;s proving problematic to package these old libraries from<br>
scratch.<br>
<br>
>From what I can devine, the primary library for generating images from<br>
SVG files is librsvg [2] which are still more-or-less maintained<br>
despite the ancient home page. Furthermore, from what I understand,<br>
librsvg provides a more complete implementation of the SVG<br>
specification than libsvg:<br>
  <a href="http://old.nabble.com/libsvg-status--td29085398.html" target="_blank">http://old.nabble.com/libsvg-status--td29085398.html</a><br>
<br>
Is there any interest in using librsvg as a backend for MapServer&#39;s<br>
SVG symbol support rather than libsvg? If this posed problems for<br>
Windows developers, another option would be to support both libsvg and<br>
librsvg. The APIs are not too dissimilar.<br>
<br>
Regards,<br>
Tom<br>
<br>
[1] <a href="http://cairographics.org/snapshots/" target="_blank">http://cairographics.org/snapshots/</a><br>
[2] <a href="http://librsvg.sourceforge.net/" target="_blank">http://librsvg.sourceforge.net/</a><br>
<span><font color="#888888">--<br>
Camptocamp SA<br>
Tom PAYNE<br>
PSE A<br>
CH-1015 Lausanne<br>
<br>
<a href="tel:%2B41%2021%20619%2010%2013" value="+41216191013" target="_blank">+41 21 619 10 13</a> (direct)<br>
<a href="tel:%2B41%2021%20619%2010%2010" value="+41216191010" target="_blank">+41 21 619 10 10</a> (centrale)<br>
<a href="tel:%2B41%2021%20619%2010%2000" value="+41216191000" target="_blank">+41 21 619 10 00</a> (fax)<br>
</font></span><br>----------<br><span><font color="#888">From: <b>Zak James</b> <span dir="ltr">&lt;<a href="mailto:zjames@dmsolutions.ca" target="_blank">zjames@dmsolutions.ca</a>&gt;</span><br>Date: 19 January 2012 15:18<br>

To: Tom Payne &lt;<a href="mailto:tom.payne@camptocamp.com" target="_blank">tom.payne@camptocamp.com</a>&gt;<br>Cc: <a href="mailto:yassefa@dmsolutions.ca" target="_blank">yassefa@dmsolutions.ca</a>, Alexandre Saunier &lt;<a href="mailto:alexandre.saunier@camptocamp.com" target="_blank">alexandre.saunier@camptocamp.com</a>&gt;, Emmanuel Belo &lt;<a href="mailto:emmanuel.belo@camptocamp.com" target="_blank">emmanuel.belo@camptocamp.com</a>&gt;, <a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a><br>

</font><br></span><br>Hi Tom,<br>
<br>
I&#39;ll defer to Thomas on the question of which library makes the most sense. I know we looked at both during the code sprint where we discussed the implementation. As I recall libsvg-cairo was easier to compile on my os x development box.<br>


<br>
Can you describe the problems that you&#39;re having? Do the functions we&#39;re using in libsvg-cairo have close matches in the librsvg? I think it&#39;s quite a small set.<br>
<span><font color="#888888"><br>
zak<br>
--<br>
Zak James<br>
Applications and Software Development<br>
DM Solutions Group Inc.<br>
<a href="http://www.dmsolutions.ca" target="_blank">http://www.dmsolutions.ca</a><br>
<a href="http://research.dmsolutions.ca" target="_blank">http://research.dmsolutions.ca</a><br>
</font></span><div></div><br>----------<br><span><font color="#888">From: <b>Tom Payne</b> <span dir="ltr">&lt;<a href="mailto:tom.payne@camptocamp.com" target="_blank">tom.payne@camptocamp.com</a>&gt;</span><br>
Date: 19 January 2012 17:45<br>To: Zak James &lt;<a href="mailto:zjames@dmsolutions.ca" target="_blank">zjames@dmsolutions.ca</a>&gt;<br>Cc: <a href="mailto:yassefa@dmsolutions.ca" target="_blank">yassefa@dmsolutions.ca</a>, Alexandre Saunier &lt;<a href="mailto:alexandre.saunier@camptocamp.com" target="_blank">alexandre.saunier@camptocamp.com</a>&gt;, Emmanuel Belo &lt;<a href="mailto:emmanuel.belo@camptocamp.com" target="_blank">emmanuel.belo@camptocamp.com</a>&gt;, <a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a><br>

</font><br></span><br>Hi Zak,<br>
<br>
It certainly makes sense to use libsvg-cairo on Windows: its has fewer<br>
dependencies. librsvg depends on a number t of the Gnome libraries,<br>
and so I imagine that it&#39;s more of a pain on Windows.<br>
<br>
The specific problems that I&#39;m having relate (currently) to libsvg<br>
version 0.1.4 (the latest), specifically src/svg_image.c, which calls<br>
PNG and JPEG functions (e.g. png_check_sig, jpeg_std_error), without<br>
(as far as I can tell) ever explicitly linking to these libraries.<br>
Similarly src/svg.c calls gzlib functions (e.g. gzdopen) without<br>
linking to the appropriate library. This later confuses Debian&#39;s<br>
automatic dependency calculation system when building the packages: it<br>
finds the calls to the functions, but cannot find the associated<br>
libraries. I think it can be fixed with a bit of autotools magic, but<br>
my autotools knowledge is a bit rusty at the moment. If you develop on<br>
Debian/Ubuntu I can share the packaging code with you.<br>
<br>
Regarding APIs, it&#39;s my first close look at the SVG code, but the APIs<br>
seem to provide similar functionality. libsvg exposes an underlying<br>
cairo context which the renderSVGSymbolCairo function in mapcairo.c<br>
manipulates with a translate and scale transformation to ensure that<br>
the symbol is correctly sized. Although at the high level librsvg<br>
seems more focused on rendering SVG images to bitmaps (GdkPixbufs), it<br>
does seem to have a function rsvg_handle_render_cairo which allows the<br>
loaded SVG (use rsvg_handle_new_from_file) to be rendered to a cairo<br>
context.<br>
<br>
Regards,<br>
Tom<br>
<div></div><br>----------<br><span><font color="#888">From: <b>Zak James</b> <span dir="ltr">&lt;<a href="mailto:zjames@dmsolutions.ca" target="_blank">zjames@dmsolutions.ca</a>&gt;</span><br>
Date: 23 January 2012 18:10<br>To: Tom Payne &lt;<a href="mailto:tom.payne@camptocamp.com" target="_blank">tom.payne@camptocamp.com</a>&gt;<br>Cc: <a href="mailto:yassefa@dmsolutions.ca" target="_blank">yassefa@dmsolutions.ca</a>, Alexandre Saunier &lt;<a href="mailto:alexandre.saunier@camptocamp.com" target="_blank">alexandre.saunier@camptocamp.com</a>&gt;, Emmanuel Belo &lt;<a href="mailto:emmanuel.belo@camptocamp.com" target="_blank">emmanuel.belo@camptocamp.com</a>&gt;, <a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a><br>

</font><br></span><br>Tom,<br>
<br>
Sorry for the delay in getting back to you on this. I agree that there are good reasons for the inclusion of both libraries but this will probably require an additional or ammended RFC. Perhaps we should move the discussion to the mapserver-dev list to get input from other developers. Can you post your response there?<br>


<div><br>
zak<br>
--<br>
Zak James<br>
Applications and Software Development<br>
DM Solutions Group Inc.<br>
<a href="http://www.dmsolutions.ca" target="_blank">http://www.dmsolutions.ca</a><br>
<a href="http://research.dmsolutions.ca" target="_blank">http://research.dmsolutions.ca</a><br>
<br>
<br>
<br>
</div><div></div><br></div><br><br clear="all"><div><br></div>-- <br>Camptocamp SA<br>Tom PAYNE<br>PSE A<br>CH-1015 Lausanne<br><br><a href="tel:%2B41%2021%20619%2010%2013" value="+41216191013" target="_blank">+41 21 619 10 13</a> (direct)<br>
<a href="tel:%2B41%2021%20619%2010%2010" value="+41216191010" target="_blank">+41 21 619 10 10</a> (centrale)<br><a href="tel:%2B41%2021%20619%2010%2000" value="+41216191000" target="_blank">+41 21 619 10 00</a> (fax)<br>

<br>
</div>