Previous Page | Next Page

The GPROJECT Procedure

Example 4: Projecting an Annotate Data Set


Procedure features:

PROC GPROJECT options:

DATA=

OUT=

ID statement

Other features:

CHORO statement

Annotate data set

Sample library member: GPJANNOT

[Sample library member: GPJANNOT]

This example illustrates how to project an Annotate data set for use with a map data set. It labels the locations of Charleston, Boston, and Bangor on the map shown in the second example. Because the X and Y variables in the USCITY data set already have been projected to match the US data set, they cannot be used with the map that is produced by the second example. To properly label the projected map, the example uses the same projection method for the city coordinates that is used for the map coordinates. This example illustrates how to use the same projection method for both data sets.

 Note about code
goptions reset=all border;
 Note about code
data us48;
   set maps.states;
   if state ne 2 and state ne 15 and state ne 72;
   if density<4;
run;
 Note about code
data cities;
   set maps.uscity(keep=lat long city state);
   length function style color $ 8
          position $ 1 text $ 20;
   retain function "label" xsys ysys "2"
          hsys "1" when "a";
   if (state=45 and city="Charleston") or
      (state=25 and city="Boston") or
      (state=23 and city="Bangor");
    state+100; color="black"; size=8; text="V";
      position="5";
      style="marker"; x=long*arcos(-1)/180;
      y=lat*arcos(-1)/180; output;
    state+1; color="black"; size=5;
      text="   "||city;
      position="6"; style="swissb"; output;
run;
 Note about code
data all;
   set us48 cities;
run;
 Note about code
proc gproject data=all
              out=allp
              project=gnomon
              polelong=160
              polelat=45;
   id state;
run;
 Note about code
data citiesp us48p;
   set allp;
   if state > 100 then output citiesp;
   else output us48p;
run;
 Note about code
title1 "Distribution Center Locations";
title2 "East Coast";
footnote j=r "GPJANNOT ";
 Note about code
pattern value=mempty color=blue;
 Note about code
proc gmap data=us48p map=us48p all;
   id state;
   choro state
         / nolegend levels=1
           annotate=citiesp;
run;
quit;

Previous Page | Next Page | Top of Page