Identifying Regions by Color

One identification approach involves color keying. This approach is demonstrated in the MapDemo demo discussed in this chapter. The demo uses the USMAP01 bitmap.

Identification by color matching relies on the fact that each region (each state) in the United States map depicted by the USMAP01 bitmap possesses a unique color value. Figure 30.2 shows the USMAP01 bitmap image displaying the contiguous United States, with Alaska and Hawaii inserted at the lower left.

The MapDemo demo contains a lookup table that matches each state’s color with the state’s name; the color choices themselves are quite arbitrary.

This approach has a few obvious restrictions, including being limited to use on systems with capacities to display more than 16 colors and requiring that the image consist of areas of continuous color. Also, any two areas with the same color value will be identified as the same region. Overall, however, it is a practical and useful method of identifying a large number of irregular regions.

Figure 30.2: The USMAP01 bitmap

© 1998 SYBEX Inc. All rights reserved.