[Mapserver-users] Wind Barbs / Truetype font annotation?

Daryl Herzmann akrherz at iastate.edu
Tue Dec 3 10:44:40 PST 2002


Hiya,

With the kind help of members of this list, I was recently able to get 
this working.  

I am pulling data from postgis, but the procedure is the same.  Here is my 
layer def...

LAYER
  CONNECTIONTYPE postgis
  NAME sknt
  # Connect to a remote spatial database
  CONNECTION "host=blahblah"
  # Get the lines from the 'geom' column of the 'roads' table
  DATA "geom from (select geom, tmpf,
    case WHEN sknt between 0 and 4.99 THEN chr(227)
       WHEN sknt between 5 and 9.99   THEN chr(228)
       WHEN sknt between 10 and 14.99 THEN chr(229)
       WHEN sknt between 15 and 19.99  THEN chr(230)
       WHEN sknt between 20  and 24.99 THEN chr(231)
       WHEN sknt between 25  and 29.99 THEN chr(232)
       WHEN sknt between 30  and 34.99 THEN chr(233)
       WHEN sknt between 35  and 39.99 THEN chr(234)
       WHEN sknt between 40  and 44.99 THEN chr(235)
       WHEN sknt between 45  and 49.99 THEN chr(236)
       ELSE chr(1) END as sknt,
    (0 - drct) as drct, oid from current WHERE sknt > 0) as foo"
  STATUS DEFAULT
  TYPE POINT
  LABELANGLEITEM drct
  PROJECTION
   "proj=latlong"
  END
  CLASS
    TEXT ([sknt])
    COLOR -1 -1 -1
    LABEL
      SIZE 38
      POSITION CC
      COLOR 255 255 255
      BACKGROUNDCOLOR -1 -1 -1
      OUTLINECOLOR -1 -1 -1
      TYPE TRUETYPE
      FONT weather
      ANTIALIAS false
      BUFFER 0
    END
  END
END

CAVEAT, I am not entirely certain that my barbs are matching the speeds.  
The ESRI Weather font is really hard to read, since the barbs are bunched 
together so tightly.  If you find errors, let me know too!

Later
  Daryl


On Mon, 2 Dec 2002, Luke Wallace wrote:

>
>I've been working on the Texas Mesonet project, and am trying to get Wind 
>Barb plots for each of the sites based upon their wind speed and direction.  
>I've looked through the archives, but the bits of code I've found don't seem 
>to work when combined together.  Below are the important parts of my main 
>mapfile
>
>SYMBOL
>  NAME 'circle'
>  TYPE ELLIPSE
>  POINTS 1 1 END
>  FILLED TRUE
>END
>
>SYMBOL
>   NAME 'wind1'
>   TYPE truetype
>   FONT 'Esri_Weather'
>   FILLED true
>   ANTIALIAS true
>   CHARACTER "b"        # symbol number in character map
>end
>
>#
># Working Point Layer
>#
>LAYER
>  NAME weather-metar
>  TYPE POINT
>  DATA currentWeather
>  STATUS ON
>  LABELCACHE OFF
>  TOLERANCE 10
>  CLASS
>    NAME 'Weather Stations'
>    COLOR 100 200 164
>    SYMBOL 'circle'
>    SIZE 7
>    TEMPLATE "weather_refresh.html"
>  END
>END
>
>#
># Non-working Barb Layer
>#
>LAYER
>  NAME weather-barbs
>   STATUS DEFAULT
>    TRANSFORM FALSE
>    TYPE ANNOTATION
>    DATA currentWeather
>    CLASS
>   	EXPRESSION "([WINDSPD] = 0)"
>   	SYMBOL 'wind1'
>   	SIZE 25
>	COLOR 0 0 0
>    END
>END
>
>I realize I'm going to need more classes (with more expressions) to get this 
>to be a truly correct barb, but I'm trying to take small steps and just get 
>any symbol to show.
>
>The following layer in my mapfile puts a single barb in the lower left 
>corner of the map. This shows my fontset is set up correctly (right?).
>
>LAYER
>    NAME credits
>    STATUS DEFAULT
>    TRANSFORM FALSE
>    TYPE ANNOTATION
>    FEATURE
>      POINTS 4 696 END
>      TEXT 'b'
>    END
>    CLASS
>      LABEL
>        TYPE TRUETYPE
>        FONT Esri_weather
>        SIZE 50
>        ANTIALIAS true
>        COLOR 0 0 0
>        POSITION UR
>      END
>    END
>END
>
>
>_________________________________________________________________
>Protect your PC - get McAfee.com VirusScan Online 
>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>

-- 
/**
 * Daryl Herzmann (akrherz at iastate.edu)
 * Program Assistant -- Iowa Environmental Mesonet
 * http://mesonet.agron.iastate.edu
 */





More information about the MapServer-users mailing list