Chapter Contents

Previous

Next
The GPROJECT Procedure

Example 1: Using Default Projection Specifications


Procedure features:
ID statement
Other features:
LIBNAME statement
Sample library member: GR23N01

This example demonstrates the effect of using PROC GPROJECT on an unprojected map data set without specifying any options. Because PROJECT= is not used in the PROC GPROJECT statement, the Albers' equal-area projection method is used by default. PROC GPROJECT supplies defaults for the standard parallels that minimize distortion of the projected map areas.

Map before Projection (GR23N01(a))

[IMAGE]

Map before Projection (GR23N01(a)) illustrates the output produced the REFLIB.US48 map data set, which contains only unprojected values, X and Y. The REFLIB.US48 Data Set shows the variables in the data set.

The REFLIB.US48 Data Set
                            US48 Data Set

           OBS    STATE    SEGMENT    DENSITY       X          Y

             1      1         1          3       1.48221    0.56286
             2      1         1          3       1.48226    0.56234
             3      1         1          3       1.48304    0.56231
        .
        .
        .

The GPROJECT procedure is used with the REFLIB.US48 map data set as input to create the projected map data set, REFLIB.US48PROJ. The values for X and Y in this new data set are projected (cartesian). The REFLIB.US48PROJ Data Set shows the variables in the data set.

The REFLIB.US48PROJ Data Set
                             US48PROJ Data Set

          OBS       X           Y        DENSITY    STATE    SEGMENT

            1    0.16068    -0.073470       3         1         1
            2    0.16069    -0.073993       3         1         1
            3    0.16004    -0.074097       3         1         1
            .
            .
            .

The new projected map data set, REFLIB.US48PROJ, is used to create the projected map, Map after Projection (GR23N01(b)).

Map after Projection (GR23N01(b))

[IMAGE]

 Note about code
libname reflib 'SAS-data-library';
libname maps 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftext=swiss htitle=6 htext=3;
 Note about code
data reflib.us48;
   set maps.states;
   if state ne 2 and state ne 15 and state ne 72;
   if density<4;
run;
 Note about code
title 'United States Map';
footnote j=r 'GR23N01(a) ';
 Note about code
pattern value=mempty repeat=50 color=blue;
 Note about code
proc gmap map=reflib.us48 data=reflib.us48 all;
   id state;
   choro state / nolegend;
run;
 Note about code
proc gproject data=reflib.us48
              out=reflib.us48proj;
   id state;
run;
 Note about code
footnote j=r 'GR23N01(b) ';
 Note about code
proc gmap map=reflib.us48proj
          data=reflib.us48proj all;
   id state;
   choro state / nolegend;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.