Resource Reference

Resource: map_file

Resource map_file
Overview Specifies the name of the map database file. Multiple maps can be specified along with attributes to describe how to draw the map.
Command Line -mf=filename...
Environment Variable wxpmap
Possible Values
Default Value wxp.map

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:

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 the five of 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.


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:


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:


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:


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

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:


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:


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:


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.

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:


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.

Last updated July 30, 1998