[mapserver-users] svg output label anomalies

sbauman at abt.net sbauman at abt.net
Wed Feb 17 09:27:19 EST 2010


Barend Köbben <kobben at itc.nl> wrote on Wed, 17 Feb 2010 11:59:40 
+0100

> Hi,
> 
> The first anomaly is because you have
>   COLOR 0 0 255
>   OUTLINECOLOR 255 255 255
> for you labels. The SVG driver mimics a separate stroke and fill color
> by having two instances, each in a different color.
>

Thanks for your reply.

It's a good theory. However, when I remove the OUTLINECOLOR directive 
the svg output file still has two copies of each label. 

Printing two copies of text is fairly common for rendering a shadow 
for vector graphics. It is not necessary for outlining the text for 
svg. Mapserver correctly distinguishes between the fill color and 
stroke/outline color in its svg text rendering. (Look at the svg text 
example in my original post).

Without looking at Mapserver's code, my guess is that no shadow 
results in one copy on top of another (no offset). This cannot be 
detected in a raster image; it can in a vector image.
 
> Your second anomaly is not clearly descibed. Do you mean the png is
> NOT rotated and the SVG is? Or is the SVG one rotated wrongly (cw
> instead of ccw), while the png is rotated correctly?
> 

I'm sorry for the confusion. Let me try to be clearer.

The png is correct. The problem with the svg. 

Labels that should be rotated ccw are rotated correctly. Labels that 
should be rotated cw are not rotated at all - they remain horizontal.

This second anomaly is the one I'd like to get resolved. One 
advantage in working with svg files is that they are text. I can 
remove the extra labels using a simple text editor application as a 
post processor. 

The label rotation anomaly presents a bigger challenge. I'm trying to 
avoid the obvious workaround - writing my own drawLabelCache routine, 
using mapscript, for rendering svg output.

Thanks for your input.


Stephen Bauman
13810 Franklin Ave 2N
Flushing NY 11355-3302
Tel: 718-359-7972  (USA)



More information about the mapserver-users mailing list