The GMAP Procedure

# Creating Map Data Sets

A unit area is defined by observations in the map data set that have the same identification (ID) variable value. A unit area may be composed of a single polygon or a collection of polygons. A polygon is defined by all of the observations that have the same SEGMENT variable value.

• If the unit area is a single polygon, all values of SEGMENT are the same.

• If the unit area contains multiple polygons, such as islands, the SEGMENT variable has multiple values. For example, in the MAPS.US data set, the state of Hawaii (a unit area) contains six different values in the SEGMENT variable, one for each island in the state.

• If the unit area contains enclosed polygons, such as lakes, the SEGMENT variable has one value but the interior polygon is defined by separate boundaries. For example, in the CANADA2 data set supplied with SAS/GRAPH, the map data for the Northwest Territories (a unit area) use enclosed polygons for two lakes.

```data square;
input id x y;
datalines;
1 0 0
1 0 40
1 40 40
1 40 0
;```

This data set does not have a SEGMENT variable.

```data map;
input id \$ 1-8 segment x y;
datalines;
square   1 0 0
square   1 0 4
square   1 4 4
square   1 4 0
square   2 5 5
square   2 5 7
square   2 7 7
square   2 7 5
;```

```data map;
input id \$ 1-8 segment x y;
datalines;
square   1 0 0
square   1 0 4
square   1 4 4
square   1 4 0
square   1 . .
square   1 1 1
square   1 2 2
square   1 3 1
;```

```data map;
input id \$ 1-8 segment x y;
datalines;
square   1 0 0
square   1 0 4
square   1 4 4
square   1 4 0
square   1 . .
square   1 1 1
square   1 2 2
square   1 3 1
triangle 1 1 1
triangle 1 2 2
triangle 1 3 1
;```

Note:   A single map segment (a section of a unit area with a single value of the SEGMENT variable) cannot contain multiple polygons without at least one observation with missing values for X and Y. All segments within the map data sets that are supplied by SAS/GRAPH contain a single polygon that can have one or more separate boundaries, each separated by an observation with missing values for X and Y.