Enter a ZIP code to get a forecast:
Setup Location

WRN Logo

Resource: map_file

Resource map_file
Command Line -mf=filename...
Environment Variable wxpmap
Default Value wxp.map
(over North America)
cont.dat,country.dat
(for other domains)

This resource is used to specify the map outline databases to plot the map background. The filename can be specified as a relative path in which the value of the file_path resource is prepended to the filename or as a full path to avoid the file_path setting.

WXP comes with a rather large set of map databases, all of which can be used to enhance plots.  Here is a list of the basic set of maps:

  • wxp.map - the standard low resolution map of North America (default for most plots)
  • cont.map - low resolution global continental outline map (default for non-N.A. plots)
  • country.map - low resolution political outline map (default for non-N.A. plots)
  • state.map - high resolution U.S. state outline map
  • wxpstate.map - low resolution state outline (derived from wxp.map) for use with cont.map.
  • usa_cnty.map - medium accuracy county outline map.
  • zones.map - forecast zone map.

There are binary versions of some of these maps created with the map2bin program.  These will have a .bmap extension.

DLG (Digital Line Graph) Maps

There is an optional set of maps derived from the USGS DLG databases.  These are high resolution maps containing outlines of:

  • country and coast lines
  • state outlines
  • county outlines (these are exclusive boundaries so you need to plot all three of these).
  • roads
  • railroads
  • streams
  • lakes and islands
  • major city outlines
  • national parks, monuments, forests
  • indian reservations
  • military reservations

All of these maps are in binary format due to the resolution and resultant size of the maps.  The WXP distribution comes with the five of these maps:

  • dlg/nation.bmap
  • dlg/coast.bmap
  • dlg/state.bmap
  • dlg/cnty.bmap
  • dlg/rd_int.bmap (Interstate highways)

Multiple Maps and Attributes

The map_file resource allows you to specify more than one map if the map file names are separated by a comma.  The maps are drawn in the order listed.

   -mf=cont.map,country.map

You can specify as many maps as you want but remember, the plot will get rather cluttered if more than 3 are specified.

In order to distinguish multiple maps, it may be necessary to change the color and style of each of the maps.  You can add add attributes:

   -mf=cont.map:co=lred:wi=2,country.map:co=red

In this example, the first map is drawn in light red with a line width of 2.  The second map is drawn in red.

Map List Files

If the command line gets too complicated, the map file specification can be put into a file.  The above line would look like:

   cont.map:co=lred:wi=2
   country.map:co=red

In a file named "globe.mpl".  Each map is on a different line, not separated by commas as with the resource specification. The file will be listed in the map_file resource as:

   -mf=fi:globe.mpl

Conditional Map Drawing

This is an important concept that uses the map specification files. WXP has an interactive zoom facility.  As the user zooms in on a region, it would be nice to be able to show more detailed maps.  There is the ability to toggle the drawing of maps on and off based on the region of the world and the size of the domain.

First, lets talk about toggling based on domain size.  The domain size is determined by the following formula:

   size = (ny-1)*dy

From the plot_domain specification.  For example the us domain (as listed in the wxp.reg file) is a 25x17 grid with a spacing of 2.3.  This makes the domain size 16*2.3 or 36.8.  Here is a table of domain sizes and what they represent

  • 200 - hemispheric
  • 100 - continental
  • 40 - scale of contiguous U.S.
  • 15-20 - small U.S. regions
  • 10 - 1 to 3 states
  • 5 - sub-state scale

You can make the map conditional by putting a ">size" or a "<size" in front of the map file name to specify whether the map is drawn if the domain is greater than size or less than size, respectively.  Here is a sample:

   >20:wxp.map
   <10:dlg/cnty.bmap:co=red
   <20:dlg/nation.bmap:co=lred:wi=2
   <20:dlg/state.bmap:co=lred:wi=2
   <20:dlg/coast.bmap:co=lred:wi=2
   <10:dlg/rd_int.bmap:co=brown
   <3:rf:counties.raw-Name:co=cyan:te=.75

Now remember order is critical.  In some cases, you may want a map to draw last so it is not obscured.  In this case, I want the interstate highway map to draw on top so it is the most visible.  Of course, the interstate map will only draw for state scale domains (size<10).  The low resolution wxp.map is replaced by the higher resolution DLG maps at a size of 20.  The last line listed is not a map at all but a raw file.  This will label each county with its name for very small domains.  The counties.raw file has several fields in it but we want to only plot the Name field from that file.

You can combine the "<" and ">" to plot a map within a specified range:

   >5<10:range.map

Regional Map Drawing

This is the second component of conditional drawing. The DLG databases are only valid over the contiguous U.S. so this map file make no sense if you are drawing a map for Europe. Regional drawing limits a set of maps to a specific region.  These are specified by a special line in the map specification file:

   [25,50,-125,-75,75]
   >20:wxp.map
   <10:dlg/cnty.bmap:co=red
   <20:dlg/nation.bmap:co=lred:wi=2
   <20:dlg/state.bmap:co=lred:wi=2
   <20:dlg/coast.bmap:co=lred:wi=2
   <10:dlg/rd_int.bmap:co=brown
   <3:rf:counties.raw-Name:co=cyan:te=.75
   []
   cont.map
   country.map

The line with the brackets [ ] specifies the valid region for the following maps.  This is based on the clat and clon specifications in the plot_domain resource.  The five numbers are the minimum and maximum latitudes, the minimum and maximum longitudes and the maximum domain size. The domain size is optional.  More than one like this can be specified in the map specification file.  The first set of maps matching the criteria are drawn.  

The blank bracket specification denotes the default set of maps.  If the domain matches non of the criteria, the default set of maps is drawn. This must be specified last.

Plotting non-maps

The map_file resource allow the users to plot non map files.

  • lalo:lat[:lon]
    Draw lat-lon lines at the specified interval.  This allows the user to control the order and when lat-lon lines are drawn.  If lon is omitted, the interval for both is the same.
  • rf:rawfile[-variable]
    Plots the contents of the raw file This is handy for labelling maps with city and county names.
  • im:image[:back:x:y]
    This overlays an image on the plot.  The image is a GIF image that can be created by WXP or another program and saved in the file image.  The value of the image_path resource is prepended to the filename if a relative path.  

    The back specifies a color that will be transparent.  The default is black.  If this plot is a reverse/inverted color (white background), the map image may have to be plotted in black in which case you would use white for the transparent color.

    The x:y specifies an offset for the image. By default, it is placed relative to the upper left corner of the plotting window.  You can offset this positive which is relative to the upper left corner of negative which is relative to the lower right corner.

    An example:

       -mf=im:earth_us.gif,im:wxplogo.gif::-1:-1 -ge=540x400

    This plots two images, the first being a relief map of the U.S. and the second being a logo placed on the map in the lower right identifying the plot as being plotted by WXP.  

    NOTE: when dealing with image background maps, it may be necessary to fix the size of the plot to match the size of the image.
  • if:image[:back:x:y]
    This overlays an image much like im: except the image is offset from the upper left corner of the window, not the plot.
  • mf:metafile
    This plots the content of a metafile.

Underlay, Overlay Maps

The map drawing is done in two ways; as an underlay and as an overlay.  For most plotting, the map is an underlay.  For color fill contouring, satellite and radar display, the map is an overlay.  To control how a map is plotted either as an underlay or an overlay, add either a "-" for underlay or a "+" for overlay:

   -im:usa_relief.gif
   wxp.map
   +im:wxplogo.gif::-1:-1

The image "usa_relief.gif" will always be plotted as an underlay.  The WXP logo will always be plotted as an overlay in the lower right hand corner.  In this case we are putting relief image under the plot and a logo over the plot.  The "wxp.map" will plot either as an underlay or an overlay depending on the default for the type of plot.

Latitude Longitude Lines

Each of the graphics programs can display latitude-longitude lines on top of the geographical map. These lines can be drawn at any specific interval. The lines are labeled at the left and bottom of the plot. The syntax is:

  • lalo:lat[:lon:plus:extra]

where the latitude spacing is lat and longitude is lon. If lon is not specified, it is set to lat. The attributes of these lines are controlled by the color_line resource.

Plus represents whether small plus signs "+" are placed at lat,lon intersections where plus is the interval between pluses.  Extra represents where extra lat, lon labels are to be placed where extra is the interval between labels.  These labels are offset from prime lines such as the equator and date line.   For example, if extra is 45, then the labels are placed at -67.5, -22.5, 22.5 and 67.5.


For further information about WXP, email technical-support@weather.unisys.com
Last updated by Dan Vietor on July 30, 1998