SIZEUNITS in Perl Mapscript

Agneta Schick schick at SDAC.HANNOVER.BGR.DE
Mon Feb 14 08:11:07 PST 2005


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 Schick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Agneta Schick

    Bundesanstalt fuer Geowissenschaften und Rohstoffe
    Federal Institute for Geosciences and Natural Resources
    Stilleweg 2
    D- 30655 Hannover                   Tel.: +49 511 643 3136
    GERMANY                             FAX.: +49 511 643 3663

    schick at sdac.hannover.bgr.de         http://www.seismologie.bgr.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the MapServer-users mailing list