Chapter Contents |
Previous |
Next |
The GMAP Procedure |
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.
Creating a unit area that is a single polygon. |
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.
Creating a unit area that contains multiple polygons. |
Use different values of the SEGMENT variable to create separate polygons within a single unit area. For example, this DATA step assigns two values to the SEGMENT variable. The resulting data set produces a single unit area that contains two polygons, as shown in Single Unit Area with Two Segments (Polygons):
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 ;
Single Unit Area with Two Segments (Polygons)
Creating a unit area that contains enclosed polygons as holes. |
Use separate boundaries to create an enclosed polygon (that is, a polygon that falls within the primary polygon for a single segment). The separate boundaries are separated from the primary polygon boundary by missing values for X and Y. For example, the data set that is created by this DATA step produces the map shown in Single Unit Area with Hole:
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 ;
Creating a unit area that contains enclosed polygons as cities. |
Ordinarily, if one unit area is surrounded by another, the pattern of the external unit area is drawn over the pattern for the internal one, instead of around it. Avoid this problem by adding an observation to the map data for the external unit area with missing values for X and Y, followed by the coordinates of the internal unit area, but using the ID values for the external unit area. For example, this DATA step creates a data set that produces the map shown in Unit Area within a Unit Area:
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.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.