[mapserver-users] Rendering weather data

Bob Basques Bob.Basques at ci.stpaul.mn.us
Tue Sep 27 15:38:41 EDT 2011


Brent,  

I was thinking about a template approach where you could build a chunk of the mapfile and using an include (this might be a good spot for that URL call BTW, at least to ask the dev list about) to get at the new chunk. 

Paul's idea about using a TTF font is much more elegant a solution, but you would either need to make your own font or find one somewhere.  That link sent by Norman leads to a TTF font with the symbols in it already. 

Another option, that I admit might become time consuming, the first time at least, would be to build the symbol pieces separately, and via thresholding/filtering in the MapFile display the correct pieces on top of each other.  This would be very similar to displaying a highway symbol on a road.  Which typically has three different symbols on top of one another for display (shield border, shield fill, number, etc). 

What increments are you trying to display in initially, 5 knot intervals, singles, or ?? 

bobb 







>>> Brent Fraser <bfraser at geoanalytic.com> wrote:


Bob,

  Maybe.  I had considered some kind of programmed CGI-based URL function to create the wind barb (hence the interest in UCAR's NCL), but I don't think mapserver has the capability to use a URL as a symbol reference (would be a nice enhancement).

   I don't know how to procedurally add components within a map file using CLASS, STYLE, and SYMBOL.  Could be done with MapScript I suppose....


Best Regards,          
Brent Fraser 

On 9/27/2011 11:54 AM, Bob Basques wrote: 


Could the barb class be built up from primitives, stem anddifferent flags on the tail, based on the numbers passed in.  Basically you would be writing the barb symbol out for each label location needed, instead of sampling from a list of many?  Just use a max/min thresholding to decide when the symbol has something added to it or not.  Still a bit laborious to setup, but I think it gets you there. 


bobb 






>>> Brent Fraser <bfraser at geoanalytic.com> ( mailto:bfraser at geoanalytic.com ) wrote:


     At FOSS4G I was struck by the number of presentations involving
weather data and time series display.  Maybe I noticed because I have a
need to render wind velocity in KML, and while I haven't settled on
mapserver to do the rendering I've been wondering how to render wind
barb symbols (see attached graphics) efficiently.

   One problem is the source data: the magnitude is in one raster file
(GRIB format, float64)  and the direction in another.  GDAL's OGR
library will read the GRIB files, but I don't know of any way to use two
rasters to define a vector layer.  I think there is some work going on
with respect to displaying vector field data in mapserver, so maybe this
will be solved by that work.  Otherwise pre-processing the two rasters
into a point datasource containing lon,lat,speed,direction attributes
may be the way to go.

   The other issue of wind barb symbol rendering may have to be solved
by hand constructing a barb for 0 knots, 5 knots, etc (50-ish symbols?)
, and having 50-ish corresponding classes (this could be a performance
problem for mapserver).  But I'm open to better ideas...  SLD?  HTTP/CGI
request?, something like one class of:

   CLASS
     STYLE
       GEOMTRANSFORM "start"
       COLOR 0 255 0
       SIZE 15.0
       SYMBOL "http://localhost/symbolgen?[speed]" ( http://localhost/symbolgen?[speed] )
       ANGLE [direction]
     END
   END

   but likely the cost of getting the symbol would be greater that
creating 50 separate class objects.

And for those interested in mapping and graphing weather data, have a
look at http://www.ncl.ucar.edu/Applications/
especially http://www.ncl.ucar.edu/Applications/barb.shtml

--
Best Regards,
Brent Fraser

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110927/5fde9463/attachment-0001.html


More information about the mapserver-users mailing list