[mapserver-users] How to display vector symbols (direction and magnitude) in MapServer?
John Maurer
maurerj at nsidc.org
Mon Aug 18 04:30:39 PDT 2008
Thanks for the suggestion, Daniel! I was unaware of the ANGLE parameter
in MapServer 5.0. One remaining concern I have, though, is how the angle
will be interpreted by MapServer? Will -90 degrees always point to the
South Pole regardless of the map projection I'm using (e.g. a polar
stereo map centered on the South Pole), or will it always just point to
the bottom of the map image regardless of the projection? i.e. Does
MapServer interpret the degrees spatially or just in terms of the image?
Unfortunately, if the latter is the case (which I suspect it probably
is) it will not solve my problem. Do you know? Thanks again!
Cheers,
John Maurer
Daniel Morissette wrote:
> John Maurer wrote:
>> Dear MapServer Users,
>> Does anybody have experience displaying vectors in MapServer? By
>> "vectors", I don't mean the usual vector vs. raster difference. What
>> I mean is displaying data like wind vectors, which are point
>> locations that have both a direction (degrees) and magnitude (e.g.
>> meters per second). Usually these are displayed as arrows, which each
>> point in a certain direction and whose tails vary in length depending
>> on the magnitude each measurement. Is this possible in MapServer?
>> Thanks for any suggestions!
>
> You could bind the symbol size and angle to an attribute in your layer
> definition.
>
> If you can precompute the size in pixels based on the wind speed and
> store that to an 'arrowsize' attribute then you could use a layer
> defn's like this:
>
> LAYER
> TYPE POINT
> ...
> CLASS
> SYMBOL 'arrow'
> ANGLE [direction]
> SIZE [arrowsize]
> COLOR 0 0 0
> END
> END
>
>
> If you can't precompute the arrow size in pixels, then you could use
> classes based on the wind speed attribute:
>
> LAYER
> TYPE POINT
> ...
> CLASSITEM 'windspeed'
> CLASS
> EXPRESSION ([windspeed] < 5)
> SYMBOL 'arrow'
> ANGLE [direction]
> SIZE 10
> COLOR 0 0 0
> END
> CLASS
> EXPRESSION ([windspeed] < 25)
> SYMBOL 'arrow'
> ANGLE [direction]
> SIZE 15
> COLOR 0 0 0
> END
> CLASS
> EXPRESSION ([windspeed] < 100)
> SYMBOL 'arrow'
> ANGLE [direction]
> SIZE 20
> COLOR 0 0 0
> END
> CLASS
> # No expression ... catch all for windspeed > 100
> SYMBOL 'arrow'
> ANGLE [direction]
> SIZE 25
> COLOR 0 0 0
> END
> END
>
>
> Daniel
--
John Maurer
Web/Database Applications Engineer
National Snow and Ice Data Center (NSIDC)
University of Colorado at Boulder
http://cires.colorado.edu/~maurerj
+1-303-586-1677
------------------------------------
"Without geography, you're nowhere!"
More information about the MapServer-users
mailing list