In addition to using
map data sets that are supplied with
SAS/GRAPH software, you can also create your own map data sets.
Map data sets are not limited to geographic data; you use them to
define other spaces such as floor plans.
When creating map data
sets with geographic data, the following variables must be included:
-
a numeric variable named X that
contains the horizontal coordinates of the boundary points. The value
of this variable is projected and represents longitude. This variable
is required by the GMAP procedure.
-
a numeric variable named Y that
contains the vertical coordinates of the boundary points. The value
of this variable is projected and represents latitude. This variable
is required by the GMAP procedure.
-
one or more variables that uniquely
identify the areas in the map. Map area identification variables can
be either character or numeric and are indicated in the ID statement.
An identification variable is required by the GMAP procedure.
The X and Y variable
values in the GfK map data set do not have to be in any specific units.
They are rescaled by the GMAP procedure based on the minimum and maximum
values in the data set. The minimum X and Y values are in the lower
left corner of the map, and the maximum X and Y values are in the
upper right corner.
Map data sets in which
the X and Y variables contain longitude and latitude should be projected
before you use them with PROC GMAP. See
GPROJECT Procedure for details.
Other variables to consider
including in map data sets are:
-
a numeric variable named DENSITY
that holds the density values returned from a GREDUCE procedure.
-
a numeric variable named LONG that
contains the horizontal coordinate of the boundary point in degrees.
The value of this variable is unprojected and represents longitude
(east-west position).
-
a numeric variable named LAT that
contains the vertical coordinate of the boundary point in degrees.
The value of this variable is unprojected and represents latitude
(north-south position).
-
a variable named SEGMENT to identify
map areas that comprise noncontiguous polygons. Each unique value
of the SEGMENT variable within a single map area defines a distinct
polygon. If the SEGMENT variable is not present, each map area is
drawn as a separate closed polygon that indicates a single segment.
The observations for
each segment of a map area in the map data set must occur in the order
in which the points are to be joined. The GMAP procedure forms map
area outlines by connecting the boundary points of each segment in
the order in which they appear in the data set. Eventually the last
point is joined to the first point to complete the polygon. All the
segments for each ID value must be contiguous within the map data
set.
-
a variable named RESOLUTION to
map detail level based on output resolution.
Refer to RESOLUTION Variable Values for a list
of the output resolutions associated with a RESOLUTION variable value.
A unit area is defined
by observations in the map data set that have the same identification
(ID) variable value. A unit area might 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 within the same unit area.
-
If the unit area is a single polygon,
then all values of SEGMENT are the same (alternatively, you can omit
the SEGMENT variable).
-
If the unit area contains multiple
polygons, such as islands, then 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 (holes), such as lakes, then the SEGMENT variable has one
value but the interior polygon is defined by separate boundaries.
To separate boundaries, a missing X and Y value must be inserted at
the separation point. 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.