Previous Page | Next Page

The GREMOVE Procedure

Example 2: Creating an Outline Map of Africa


Procedure features:

PROC GREMOVE options:

DATA=

OUT=

Other features:

GMAP procedure

Sample library member: GRMAFRIC

This example processes the MAPS.AFRICA map data set, supplied with SAS/GRAPH, to produce a new map data set that contains no internal boundaries. This is done by adding a new variable, REGION, to the map data set and setting it equal to 1. Unit areas from the input map data set that have the same BY-variable value are combined into one unit area in the output map data set. The MAPS.AFRICA Data Set shows some of the variables that are present in the original map data set:

The MAPS.AFRICA Data Set

                            MAPS.AFRICA Data Set
                 OBS     ID    SEGMENT       X          Y

                   1    125       1       0.57679    1.43730
                   2    125       1       0.57668    1.43467
                   3    125       1       0.58515    1.42363
                   .
                   .
                   .
                3462    990       1       1.04249    0.50398
                3463    990       1       1.04184    0.50713
                3464    990       1       1.04286    0.50841

Map before Removing Borders (GRMAFRIC(a)) shows the map before processing:

Map before Removing Borders (GRMAFRIC(a))

[Map before Removing Borders (GRMAFRIC(a))]

The new AFRICA map data set is created with a new variable, REGION. The AFRICA Data Set shows the variables that are present in the new map data set created by the GREMOVE procedure:

The AFRICA Data Set

                           AFRICA Data Set
               OBS       X          Y       SEGMENT    REGION

                 1    0.24826    1.02167       1          1
                 2    0.25707    1.02714       1          1
                 3    0.26553    1.03752       1          1
                 .
                 .
                 .
               982    1.19071    1.30043       3          1
               983    1.18675    1.30842       3          1
               984    1.18518    1.32822       3          1

Map after Removing Borders (GRMAFRIC(b)) shows the new map after PROC GREMOVE has removed all of the interior boundaries:

Map after Removing Borders (GRMAFRIC(b))

[Map after Removing Borders (GRMAFRIC(b))]

 Note about code
goptions reset=all border;
 Note about code
data newaf;
   set maps.africa;
   region=1;
run;
 Note about code
proc gremove data=newaf out=africa;
   by region;
   id id;
run;
 Note about code
title "Africa with Boundaries";
footnote j=r "GRMAFRIC(a) ";
 Note about code
pattern value=mempty color=blue;
 Note about code
proc gmap map=maps.africa data=maps.africa all;
   id id;
   choro id / nolegend levels=1;
run;
 Note about code
title "Africa without Boundaries";
footnote j=r "GRMAFRIC(b) ";
 Note about code
proc gmap data=africa map=africa;
   id region;
   choro region / nolegend levels=1;
run;
quit;

Previous Page | Next Page | Top of Page