SIZEUNITS in Perl Mapscript

Lowell Filak lfilak at MEDINACO.ORG
Tue Feb 15 08:56:19 EST 2005


The following message was sent by Agneta Schick
<schick at SDAC.HANNOVER.BGR.DE> on Mon, 14 Feb 2005 17:11:07 +0100.

> Problem: symbol size doesn't scale
> Software: MapServer version 4.2.3, Perl MapScript
>
> Is my understanding of SIZEUNITS correct?:
>         I can define SIZEUNITS to kilometers, define a symbol 'circle'
>         and by setting the symbol size to my radius (in kilometers),
>         this symbol will scale to my zoom depth?
>
> My symbol always has the same pixel size as if SIZEUNITS uses the default
> PIXELS.
>
> I checked the user group mails but found no clue, except that other users
> also had problems.
>
> The layer in question is
> LAYER
>    NAME 'percept'
>    TYPE point
>    STATUS on
>    PROJECTION
>          "proj=latlong"
>          "datum=WGS84"
>    END
>    SIZEUNITS kilometers
>    CLASS
>     STYLE
>      SIZE 1
>      SYMBOL 'circle'
>      OUTLINECOLOR 0 0 240
>     END
>    END
> END
>
> and the perl snippet:
>                 $layer = $map->getLayerByName('percept');
>                 $class = $layer->getClass(0);
>                 $style = $class->getStyle(0);
>                 $style->{size} = int($radius);
>                 $point = new mapscript::pointObj();
>                 $point->{x} = $lon;
>                 $point->{y} = $lat;
>                 $point->draw($map, $layer, $img, 0,0);
>
> I appreciate any help in this matter since 'racking my brain' doesn't help
> me at all!

Agneta,

If I'm understanding things correctly, sizeunits effects the 'class'
size and not the 'style' size.

Lowell



More information about the mapserver-users mailing list