WXP version 5
User's Guide

Map Plotting

Most WXP graphics programs plot Maps.  By default, the wxp.map file plots for plot domains over North America. Otherwise, the program will draw a map based on the cont.dat and country.dat files. If another map is needed, the map_file resource is used to specify a list of maps to plot.  The filenames listed by the resource 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:

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:

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

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 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 to compilcated, 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 the ability to toggle the drawing of maps on and off based on the region of the world and the size of the domain. As the user zooms in on a region, the maps that are drawn will change to add more detail if needed.

The criteria for toggling maps are based on domain size.  The domain size is determined by the following formula:

   size = (ny-1)*dy

Ny and Dy are 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

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 these map files make no sense if you are drawing a map for Europe. Regional drawing limits a set of maps to a specific region.  The region limits are specified on a line with the brackets [ ]:

   [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 five numbers of the region limits are the minimum and maximum latitudes, the minimum and maximum longitudes and the maximum domain size. This set of maps (between region specifications) will be drawn if the central latitude and longitude (from the plot_domain resource) is within the range specified and the domain size is less than the maximum size. The domain size is optional. More than one like this can be specified in the map specification file. The blank bracket specification denotes the default set of maps. If the domain matches none of the criteria, the default set of maps is drawn. This must be specified last.

Plotting non-maps

The map_file resource allows the users to plot non-map files.

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:

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.

Binary map file interface

The mapping programs take binary data files for speed. There is a program called map2bin which converts the map files into a binary form WXP can handle. WXP automatically senses when it is using a binary map file. Binary map files plot up to 5 times faster.


Last updated July 21, 1998