[mapserver-dev] Question on SVG symbol sizes

Stephen Woodbridge woodbri at swoodbridge.com
Wed Mar 14 11:56:47 PDT 2012


Hi Thomas,

I think this is working now. I'm not sure what the problem was, but I 
resized the files in Inkscape and saved them and now they seem to be 
scaling based on the MINSIZE, MAXSIZE paramaters. It is likely the 
Inkscape modified or deleted some problematic tags in the svg file.

If I have the original files still here, I'll look at the XML and see if 
anything obvious stands out.

Meanwhile, I want to convert all my POI/Landmark symbols to SVG.

I also use an image file for the country borders that is basically a 
wide white line with a smaller black line down the center. I can 
probably just replace that with two styles like for wide roads.

At that point, all the symbols and styles should be scalable so 
generating a PDF or print image with higher output resolution should 
work great.

If you have a chance, can you look at my patch on #4247 and check it in 
if it looks ok to you.

Thanks,
   -SteveW

On 3/14/2012 2:20 PM, thomas bonfort wrote:
> Steve,
> I haven't experimented with svg symbols extensively. I did add some
> autotests that use scaling and rotating, and it would seem to work:
>
> http://trac.osgeo.org/mapserver/browser/trunk/msautotest/renderers/point_svg.map
> http://trac.osgeo.org/mapserver/browser/trunk/msautotest/renderers/expected/point_svg.png.png
>
> ps: looking at the link you sent, the symbols seem correct to me. is
> this still an issue ?
>
> --
> thomas
>
> On Wed, Mar 14, 2012 at 17:04, Stephen Woodbridge
> <woodbri at swoodbridge.com>  wrote:
>> Hi SVG devs,
>>
>> I have a question on SVG symbols in mapserver and how do you change the size
>> of the rendered symbol.
>>
>> For example I have an SVG symbol for a US hwy shield that was built 600x600
>> pixels.
>>
>> I want it to render 20x20 pixels in my map image output. I have a LAYER
>> definition like the following. I just added a patch to #4247 to get this to
>> render at all, but the symbol is rendered very large.
>>
>> http://imaptools.com:8080/cgi-bin/mapserv-6.1-dev?MAP=%2Fu%2Fdata%2Ftiger2011-maps%2Ftiger2011-tmp.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Tiger_2011&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=-10485490.899012,3960784.0007718,-10057443.551356,4297106.9167874&WIDTH=700&HEIGHT=550
>>
>> Since this is a lot of new code all getting dumped into trunk, I don't know
>> if I am looking at a bug or user error or what?
>>
>> Any thoughts on this?
>>
>> Thanks,
>>   -SteveW
>>
>> LAYER
>>   NAME "roads"
>>   TYPE LINE
>>   TILEINDEX "tidx-ROADS"
>>   MAXSCALEDENOM 500000
>>   CLASSITEM "RTTYP"
>>   LABELITEM "FULLNAME"
>>   SIZEUNITS METERS        # zoom dependent scaling
>>   CLASS
>>   CLASS
>>     EXPRESSION /^[USC]/
>>     STYLE
>>       COLOR "#FFFB89"
>>       WIDTH 18
>>       OUTLINECOLOR "#ECD390"
>>       OUTLINEWIDTH 1
>>     END
>>     LABEL
>>       MAXSCALEDENOM 200000
>>       EXPRESSION ('[RTTYP]' = 'U'&&  '[RTENUM]' ~ '.')
>>       TEXT '[RTENUM]'
>>       STYLE
>>         #GEOMTRANSFORM 'labelpnt'
>>         SYMBOL "U"
>>         SIZE 20
>>         MINSIZE 20     # override zoom dependent scaling
>>         MAXSIZE 20
>>       END
>>       SIZE TINY
>>       POSITION CC
>>       #OFFSET 1 0
>>       MINDISTANCE 100
>>       COLOR "#000000"
>>       PARTIALS FALSE
>>       PRIORITY 7
>>     END
>> END
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list