MAPDATA

Version 2.1

Data Mapping Application

for Microsoft Windows

User's Guide


Copyright © 1987-1995 by Glenn C. Slayden and Robert C. Douglas

Windows,Windows/286, Windows/386, and Excel are trademarks of Microsoft Corporation
Designer is a trademark of Micrografx Corporation
PageMaker is a trademark of Aldus Corporation

INDEX

1. Introduction
2. Installation
3. Starting MAPDATA
4. Sample Session
5. Commands
6. Without a Mouse
7. Version 2.1 Changes
8. MAPDATA Data Files
9. Technical Information

1. Introduction

MAPDATA is a flexible and powerful graphics presentation tool for Microsoft Windows. The program brings together two basic types of files to create an image. The first file, the boundary file, describes several polygons, which can be anything from geographical regions (states, countries, etc.) to arbitrary shapes. This file also contains identifying information for each polygon. The second type of file, the data file, contains code numbers which can be used to color the regions from the boundary file. MAPDATA automatically matches data files with the boundary files in the workspace so that only the relevant data is displayed. Once the data and boundary are displayed, the user can change the colors used for each data item, zoom in repeatedly and arbitrarily, enter a title or legend for the map, or print the map.

MAPDATA can perform two levels of data matching. These two levels are called minor divisions and major divisions. In a typical map, the major division might be a county while the minor divisions are the towns in that county. Or, the major division might be a state while the minor divisions are the counties in that state. In this example, MAPDATA's two levels of data matching means that you can look at the same data variable for different states without having to change the data file. Just call up a new boundary file and MAPDATA matches the data.

MAPDATA also automatically scales boundary files to fit within the application's window. This feature also allows for scaled display of several boundary files at once.

The most efficient use of MAPDATA will be realized when it is used in conjunction with other Windows tools such as Microsoft Excel or Microsoft Write. A column of data in Excel, for example, can easily be copied to the clipboard and pasted into MAPDATA. MAPDATA can then copy a full color map to the clipboard for pasting into a word processor such as Write, a desktop publishing program such as Aldus PageMaker, or a drawing program such as Micrografx Designer. With the latter program, polygons can even be individually extracted from the map. The original data from Excel could be added to highlight the document.

2. Installation

MAPDATA is not copy protected. The entire program is contained in a single Microsoft Windows executable file. To use it you must have Microsoft Windows version 2.03 or higher, or Microsoft Windows/386 installed on your computer. You must install Windows before installing MAPDATA. To install Windows, follow the installation instructions which came with your Windows retail package. The minimum hardware requirements for the program are the same as the minimum hardware requirements for Microsoft Windows.

The MAPDATA distribution disk contains one executable program file, MAPDATA.EXE. In addition, there should be a documentation file, README.TXT. The remaining files are demonstration files, and they may be identified by their file extension as follows:

.DMF Data Map File--binary file containing a single data variable
.BND Boundary file--binary file containing the turning points of a map
.GRP Group file -- Text file containing a list of boundary file names
.XLS Excel spreadsheet -- demo mapping spreadsheet for Microsoft Excel
.XLC Excel char -- a demonstration mapping chart for Microsoft Excel
.XLW Excel worksheet -- mapdata workspace in Excel

To install MAPDATA on a hard disk, simply copy all the files from the MAPDATA distribution disk to your hard disk using the DOS copy command. If you want MAPDATA to be put in the directory with Windows, and you did not alter the default Windows installation, you would first make the \WINDOWS directory the current directory by typing:

C> CD\WINDOWS

Then, if your hard disk is drive C:, you would place the distribution disk in the first floppy drive and type the following to copy all the files:

C> COPY A:*.*

Because MAPDATA frequently reads the boundary files on your disk when it is drawing the screen, the program's performance will be poor if the boundary files are stored on a floppy disk. For this reason, floppy disk installation of MAPDATA is not recommended. Boundary files should be copied to a hard disk before they are used, if possible. In a minimal installation, however, remember that the only file needed to operate the program is MAPDATA.EXE.

If you have Windows/286 or Windows/386, be sure to carefully follow the installation instructions so that memory usage will be optimal for your system. Although MAPDATA does not explicitly use EMS memory itself, if EMS is available Windows will store portions of MAPDATA there when these portions are not in use. Since you may want to use MAPDATA with other applications such as Microsoft Excel, this temporary storage can boost Windows' performance. If you will be using MAPDATA with other applications often, a minimum of 1 megabyte of EMS memory is strongly recommended.

3. Starting MAPDATA

Mapdata requires version 2.03 or higher of Microsoft Windows/286 or Windows/386. To start MAPDATA from within Windows, either double click on the program's name in Windows' MS- DOS file list, or select Run from the MS-DOS file menu. If you want to start MAPDATA from the DOS command line and you have Windows 2.03 or Windows/286, type win mapdata. If you have Windows/386, type win386 mapdata. To run it alone within Windows (without MS-DOS executive), type win :mapdata.

4. Sample Session

There are some sample data sets on the MAPDATA distribution disk. Most of these contain data for the United States by State. They can easily be viewed by opening the boundary file "UNITED.BND" from the Boundary File menu. Minor and Major code numbers for these states can be viewed by pressing the RIGHT mouse button while pointing to a state. Next, open a data file such as "USCOLLEG.BND" using the Boundary File selection. The data should appear as different colors on the United States map.

Zooming and dezooming can be accomplished by dragging the mouse--clicking the mouse and holding the button down while describing a smaller rectangle. MAPDATA will draw the zoomed area when the button is released (The bounded area must contain at least one turning point in order to be visible). Additional parts of the map may appear if they fit in the screen space created by a constraint of fitting the shape of your zoom to the shape of the application window. Use the Back menu selection to restore the full view of the map. You may also zoom again from a zoomed position.

A different data file may be viewed by selecting Data File from the menu and double-clicking on the name of the new data file. The files that start with the letters US contain data for the United States by state.

Now we'll enter some data ourselves. Minimize MAPDATA to an icon by clicking on the large downward-pointing arrow in the upper right hand corner of MAPDATA. Find Microsoft Windows Write in the MS-DOS file list. (If required, double click on the disk drive icon to restore the MS-DOS executive.) Double-click on Microsoft Write to start the application.

Type the following keystrokes: ([TAB] = the tab key, [ENTER] = the enter key)

48[TAB]1[ENTER]
1[TAB]2[ENTER]
23[TAB]3[ENTER]
41[TAB]4[ENTER]

Now drag the mouse over this data, creating a black rectangle which holds all the data. Copy the data to the clipboard by selecting "Copy" from Write's Edit menu. We just entered some data which will be presented to us by MAPDATA. Close Write and do not save the changes to this document.

Restore the MAPDATA-icon by double-clicking on it. And paste the data into MAPDATA by selecting Paste Data. If all goes well, a dialog box should appear asking you for an optional title or breakpoint information. Fill in any title, if you like. Press enter to continue.

Now the data should show up--with Texas, Alabama, Maine, and Oregon showing the data colors that we entered in Write. The colors of these data items can be changed from the Colors menu.

5. Commands

This section documents the commands which can be selected from MAPDATA's menu bar. To select a command, point to the menu name and click the mouse button until a menu bar with subchoices appears. Point to the desired subchoice and press the button again. Commands which are followed by an ellipsis (. . .) on the menu will cause a dialog box to appear prompting you for further information. If you don't have a mouse, press and release the Alt key on your keyboard to activate the menu bar. Then use the arrow keys and the enter key on your keyboard to select a menu. For more information on using Microsoft Windows, refer to the Microsoft Windows documentation.

File

When you click the File option you will be given seven choices, Boundary File, Boundary Group, Data File, Print, Printer Setup, Exit, and About. These choices perform the basic data-selection functions of MAPDATA.

The first option, Boundary File, lets you select the file which contains the desired map. Selecting a valid file from the dialog box will cause the file to be displayed on the screen. If there is no display, it is possible that you accidentally pressed the mouse button an extra time, causing the workspace to zoom to a point. Select Back from the menu bar to de-zoom.

More than one boundary file may be selected at once by returning to the Boundary File menu item and the resulting dialog box to select another file. The screen will show the largest possible view of multiple boundary files in their relative positions. A quicker way to bring up multiple boundary files is with the "Group" option described below. The same boundary file may not be selected for display more than once. To remove all the boundary files, use the "Clear Boundary" option described below.

It is possible, although not useful, to bring up multiple boundary files with different scopes on the screen. For example, the United States by state can coexist with a map of California by county, although the scales on the two maps might be unrelated.

The Boundary Group menu selection produces a dialog box which allows you to select a group file. A group file is a text file with a list of boundary file names in it. When the file is selected, all the boundary file names in the list will be opened as if the Boundary File option had been used repeatedly.

The file can be created, viewed, or edited with the Windows Notepad program. The file must begin with the capitalized word "GROUP" as the only text on the first line and end with the word "END" on a line by itself. Also, there should be at least one blank line after "END." Any text on lines after "END" will be ignored and can be used for comments. Group files should usually have the file extension ".GRP".

Between the two keywords, DOS filenames should be listed, one per line. Any path or drive information is discarded from these filenames when the group file is opened, and the current drive and directory are prepended to the resulting file name. This means that the .GRP file must be in the same directory as the boundary files (.BND) it refers to, and that boundary files MUST NOT be deleted while they are being displayed by MAPDATA.

Like the Boundary File menu selection, Boundary Group may be selected more than once. If a file listed in the group file is already displayed, or if another boundary file with the same major code as a listed file is displayed, an informative message will appear indicating that that entry in the group file is not being processed. See the technical information section for information about code numbers.

The data file contains all the observations of a demographic variable: crime rates or population densities, for example. It can be selected for display by choosing the Data File menu item. Only one set of data can be displayed on the workspace at one time. Selecting a data file will automatically replace any data file already displayed. In addition, the map legend and title will be activated whenever this menu item is chosen.

The menu item Print will print the contents of the display on the default Windows printer. This option is affected by the settings of the Legend and Title switches, so select the appropriate switches before selecting this menu item. If the display is zoomed, the only the zoomed area will be drawn. An outline map will never be printed, regardless of the setting of the Outline Option. Similarly, the mouse coordinates are never printed on the map.

The Print option is not enabled during screen redrawing, and screen redrawing is not possible during printing. (Windows may not provide enough Display Contexts to perform both operations simultaneously.) Although MAPDATA may not be used while it is sending a file to the Windows spooler or directly the printer, you can switch to other applications to use them during this time. You can resume using MAPDATA when the "Printing" dialog box disappears. To cancel printing, push the ABORT button on Mapdata's "Printing" dialog box.

Depending on the printer resolution, the presence of the Windows print spooler, the complexity of the image, and the speed of the temporary storage medium, printing times can vary widely.

If nothing comes out of the printer after the spooler has completed the printing job, it is likely that there was not enough disk space for temporary files needed by the spooler.

The Printer Setup menu choice causes a printer-specific setup dialog box to appear. The layout of this dialog box varies depending on the Windows selected printer.

The Exit option closes the application. MAPDATA can also be terminated by double-clicking on the system menu icon in the upper-left corner of the application's window. Or Alt-F4 will quickly terminate the application.

The About option gives information about MAPDATA, including version number, authors, and distributor.

Edit

The Edit menu has five sub-choices: Set Copy Size, Copy Map, Paste Data, Clear Boundary and Clear Data.

The Set Copy Size option allows you to change the size that MAPDATA recommends to an application when MAPDATA copies its map to the clipboard. This may be specified as either a vertical or horizontal size--the other dimension is determined by the aspect ratio of the map. Some receiving applications may ignore this information.

The Copy Map option copies the map to the clipboard in Windows metafile (picture) format. For large maps, this operation may take a while or require a lot of free memory. Caution: Version 2.1 of MAPDATA does not allow you to interrupt this operation! To activate this option in one step, hold down the control key while you press "Ins" on the keyboard. Copy Map is only enabled when there is a map on the display and a the screen is not being redrawn.

The Paste Data option is used to take tab-separated columns of data from the clipboard as data for a map. This data format is compatible with other Windows applications such as Microsoft Excel or Microsoft Write. Paste Data is only enabled when there is text on the clipboard. If the format is text and it is properly formatted according to MAPDATA, MAPDATA will display a dialog box which allows you to enter information related to the title and legend of the data. You can also specify a file name for permanently saving the file in MAPDATA's "DMF" format. A keyboard shortcut for Paste Data is to hold down the shift key while you press "Ins."

Data is matched automatically to the MINOR and MAJOR codes in the boundary files. If you bring data in and it doesn't show up, the codes probably don't match. Refer to section 8 of this Users Guide for details on data format.

The Clear Boundary option is enabled only when there is a map on the screen. It is used to remove this map from the memory. The "Del" key on the keyboard can be used to activate this option. Note that this is a quick way to abort the redrawing of the screen.

The Clear Data option is enabled when there is a data file opened, and can be used to clear this set of data. Shift+Delete will also perform this operation.

Zoom

The Zoom option allows you to select a small area and enlarge it. Version 2.1 of MAPDATA even allows you to zoom in or out (using the Back option) before screen repainting is complete.

To zoom with a mouse, simply press, hold, drag, and release the mouse button to define two corners of a rectangle to enlarge. To cancel the operation before releasing the button, press escape. A zoomed area must have at least one turning point in order to be visible. Be careful of selecting the MAPDATA window by clicking on its client area, since this will cause a zoom to a point and may thus blank the workspace. Clicking Back will restore the screen in this case.

The Zoom option on the menu is only enabled when there is no mouse attached to the computer. It serves the same purpose as zooming with the mouse. Select Zoom, then use the cursor control keys to move the pointer. Press enter to mark the corners of a rectangle to zoom.

Back

To return to the original "maximum view" screen after zooming, use the Back option. If no map appears at any time, try pressing the Back option--you may have accidently zoomed on a small point. Note that, like Zoom, Back can be selected even during screen repainting.

Colors

The Colors menu contains options which affect the way the map and data appear on the screen.

The first option, Outline, is a toggle which will cause subsequent sceen repainting to be quicker. If there is a checkmark next to this menu choice, then Outline drawing is selected. Each time this item is selected it toggles its value. This feature can be useful for finding a desired zoom view, or for viewing maps on slower computers. Note that the data colors are not displayed in this mode but the title or legend may be.

The next six sub-choices under the Colors heading menu allow you to change the colors on the map, or in case of a black and white monitor or printer, the pattern of cross-hatching that you want. These choices are marked Data Color X, Background, or No Data. Any one of these selections will cause a dialog box with color selections to appear. The No Data option selects the color that MAPDATA will use to color states with no reported data. The Background option selects the color that MAPDATA will use to color the screen background. Note that this option does not affect printed output. The Data Group options select the colors that MAPDATA will use to represent each of the four possible data items.

After the colors are selected, close the dialog box. With a keyboard, do this by first pressing ALT, then using the arrow keys to select "Close." With a mouse, double-click on the close icon to close the dialog box. Since this dialog box is modeless, you may work with MAPDATA while it remains on the screen, if you wish.

If you are running another instance of MAPDATA, the two instances will automatically share the same Background color. Each instance may have its own data colors, however.

The Save Settings option allows you to save all the current settings of colors or patterns in the [MapData] section of the WIN.INI file. This makes these colors permanent. These colors will be reloaded any time MAPDATA is subsequently started. The setting of the Outline toggle is also saved.

The Restore Settings option will read the colors from the WIN.INI file, to allow you to go back to the colors and settings that were saved last. The map will be redrawn with the new colors.

Map

The Map option allows you to remove the title, legend or both from the map display. If there is a check mark in front of the word, then the corresponding item will be displayed. The Show Coordinates option displays the coordinates of the mouse while it is in use.

Help

MAPDATA contains an indexed help system, which may be accessed by pressing function key F1, or by clicking on the word "Help" on the main menu bar. Note that the help system requires a significantly larger block of free memory than does any other part of the program, so be sure to close unneeded applications before using MAPDATA's help. The help system contains some information not listed in this manual. The help window will appear when the help system is active. The help window will always show either the help index, or the help text screen. From the index, double click (or press enter on) the topic of your choice. The help window display will switch to the help text screen, and the selected topic will be displayed.

The help window may be resized for easier reading, or the scroll bar may be used to browse through the topic. Additional topics may be viewed with the Prev and Next menu options, or the index can be called up again with the Index menu item. The Map option provides a means for the mouseless user to switch back to the main MAPDATA window without closing the help system. The help text can be left on the screen while you continue to work with MAPDATA.

6. Without a Mouse

Even if you have a mouse, keyboard shortcuts applicable to all Windows programs can be found in the Microsoft Windows User's Guide. This document explains all aspects of the Windows keyboard interface, many of which are beyond the scope of this User's Guide.

The only MAPDATA feature which may be inaccessible to mouseless users is the display of the region codes, which is normally accomplished with the RIGHT mouse button.

7. Version 2.1 Update Notes

Version 2.1 of MAPDATA sets up its color brushes differently than does version 1.2, so you may want to delete the [datamapper] section of your WIN.INI file before using version 2.1. The section is now called [mapdata], so that both versions could coexist.

The RIGHT mouse button causes a display of the minor and major codes for the pointed-to region. Also included is the segment number and the number of polygon verticies.

The program now supports re-entrant asynchronous redrawing. This means that MAPDATA and other applicatons can be used while MAPDATA is repainting the screen. All operations are supported during redrawing except printing, copying the map to the clipboard, and viewing the geographic codes (Right mouse button).

MAPDATA now allows multiple instances. This means you can run two copies of the application at once. With more than two instances of the program, however, there may be a shortage of Display Contexts during lengthy concurrent redrawing operations. One way to avoid this problem is to keep inactive instances minimized. Redrawing is disabled when the instance is minimized.

The user documentation has been thoroughly upgraded. A complete indexed online help system has been implemented. This help window can be kept open while working with the application.

The outline option provides another method for speeding up the screen redrawing when the data values are not important.

Banded printing is now supported.

8. MAPDATA Data Files

USAGE.DMFMedian age of population in 1980.
USAREA.DMFLand area in square miles.
USASIAN.DMFPercent Asian population.
USBLACK.DMFPercent Black population.
USCOLLEG.DMFPercent college graduates.
USCRIME.DMFKnown serious crimes.
USDENSIT.DMFPopulation density in 1980.
USDISPIN.DMFDisposable income per capita 1980.
USDIVORC.DMFDivorce rate 1980.
USGROWTH.DMF1970-1980 population growth.
USHISPAN.DMFPercent Hispanic or Spanish population.
USHSCHOO.DMFPercent High School graduates.
USMALES.DMFMales per 100 females.
USPOPULA.DMFU.S. population.
USPTAX.DMFProperty tax per capita in dollars.
USRENT.DMFMedian rent in dollars in 1980.
USSODA.DMFSoda consumption, gallons per capita.
USUNEMP.DMFUnemployment rates for 1980.
USURBAN.DMFPercent urban for 1980.
USWHITE.DMFPercent White population in 1980.

9. Technical Information

Clipboard Data Format

Text-formatted data only can be pasted into a map. Furthermore, the data must be in 2 or 3 tab-separated columns. If two columns are provided, the first column is the MINOR DIVISION CODE and the second column is the COLOR CODE, a number from 1 to 4. If three columns are provided, the first column is the MAJOR DIVISION CODE, the second column is the MINOR DIVISION CODE, and the third column is the COLOR CODE. For the United States as a whole, the MAJOR DIVISION CODE is zero and the MINOR DIVISION CODE is the state FIPS code. For the United States by county, the MAJOR DIVISION CODE is the state FIPS code and the MINOR DIVISION CODE is the county FIPS code.

FIPS CODES are as follows (This list can also be accessed through MAPDATA's online help system):

Alabama1Minnesota27Utah49
Arizona4Mississippi28Vermont50
Arkansas5Missouri29Virginia51
California6Montana30Washington53
Colorado8Nebraska31West Virginia54
Connecticut9Nevada32Wisconsin55
Delaware10New Hampshire33Wyoming56
D.C.11New Jersey34
Florida12New Mexico35
Georgia13New York36
Idaho16North Carolina37
Illinois17North Dakota38
Indiana18Ohio39
Iowa19Oklahoma40
Kansas20Oregon41
Kentucky21Pennsylvania42
Louisiana22Rhode Island44
Maine23South Carolina45
Maryland24South Dakota46
Massachusetts25Tennesse47
Michigan26Texas48

Data Files

The data (.DMF) file has a single fixed length header as follows:

length comment
TITLE 50 ASCIIZ Title of the data, zero terminated
CR 1 Carriage Return
LF 1 Line Feed
LOW 10 ASCIIZ Lowest data value
BREAK1 10 ASCIIZ First Break Point
BREAK2 10 ASCIIZ Second Break Point
BREAK3 10 ASCIIZ Third Break Point
HIGH 10 ASCIIZ Highest Data Value
NUL 2 Binary zeros
ENTRIES 2 Intel format (LSB,MSB) word=number of rows

The entries follow immediately and have the following format:

MAJOR 1 Byte MAJOR DIVISION CODE
COLOR 1 Byte COLOR CODE, must be 1, 2, 3, or 4.
MINOR 2 Intel format word, MINOR DIVISION CODE

Group Files

A group (.GRP) file is a method for pulling up several boundary files simultaneously. It consists of a simple list of the desired filenames with or without drive designators and path specifications. Selecting this file from the group menu will cause all the listed files to be drawn on the workspace.

The file must start on the very first line in the first position with the capitalized keyword GROUP. Each entry is on a separate line, and the last line must be END. Any text appearing after the END will be ignored. At least one blank line should follow end, but no blank lines must appear between GROUP and END.

After the appropriate boundary files are installed on a hard disk, a group file for New England may look like this:

------------------------------Top of File---------------------
GROUP
\MAPPING\BOUNDARY\NEW_YORK.BND
C:\MAPPING\BOUNDARY\CONNECTI.BND
VERMONT.BND
NEW_HAMP.BND
C:\MAPPING\BOUNDARY\MAINE.BND
C:\MAPPING\BOUNDARY\RHODE_IS.BND
C:\MAPPING\BOUNDARY\MASSACHU.BND
END

a comment may appear here
-----------------------------End of File----------------------

Boundary Files

The EXTRACT program is provided with version 2.1 as an aid to creating binary boundary files for MAPDATA. A future version of the MAPDATA program may be able to read ASCII files directly.

The EXTRACT.BAS program runs under the MS-DOS BASIC interpreter or it may be compiled for faster operation. It takes as input the following ASCII files which should be in the current directory (the same directory as the EXTRACT program):

TEMP.MNM - contains just ASCII six comma-separated integers on a single line:
Master FIPS Code, XMAX, YMAX, XMIN, YMIN, Number of Keys
TEMP.KEY - contains (Number of Keys) lines of the following in ASCII
County number, Segment number, Number of Turning Points
TEMP.DAT - contains the exact number of turning points in the specified order.
These points should be positive integers less than 32767 in ASCII
X, Y

The filenames must be exactly as above. Running the program EXTRACT will cause the binary output file "TEMP.BND" to be created. This is the MAPDATA format boundary file. The sample data source is the United States by state.

The actual binary boundary file has two headers. The first is fixed length, six Intel words as follows:

MAJOR 2 The MAJOR DIVSION CODE for this whole file. U.S. is zero
XMIN 2 The minimum x coordinate. Must be 0 < XMIN < XMAX
XMAX 2 The maximum x coordinate. Must be XMIN < XMAX < 32767
YMIN 2 The minimum y coordinate. Must be 0 < YMIN < YMAX
YMAX 2 The maximum y coordinate. Must be YMIN < YMAX < 32767
NUM 2 The number of MINOR DIVISIONS in this file

Next there are NUM occurrences of the following:

MINOR 2 The MINOR DIVISION CODE for each subdivision
SEGS 2 The number of the polygon that comprises a subdivision
POINTS 2 The number of points in the polygon

The data points themselves follow. The polygons that they describe need not start at the same point as they begin--they will be closed automatically. The points are in the following format:

X 2 Intel format X-coordinate
Y 2 Intel format Y-coordinate

Thus, the Delaware boundary file looks like this (but in binary):

10 MAJOR: the FIPS code
27784 XMIN
28406 XMAX
18706 YMIN
19742 YMAX
4 NUM
1,1,154 MINOR,SEGS,POINTS: polygon 1 for county 1 has 154 points
3,1,182 MINOR,SEGS,POINTS: polygon 1 for county 3 has 182 points
3,2,6 MINOR,SEGS,POINTS: polygon 2 for county 3 has 6 points
5,1,398 MINOR,SEGS,POINTS: polygon 1 for county 5 has 398 points
28174,19127 X,Y
28177,19111 X,Y
28175,19111 .
28173,19115 .
28170,19114 etc . . .