Procedure features: |
|
Other features: |
CHORO statement |
Annotate data set |
|
Data set: |
REFLIB.US48
|
Sample library member: |
GR23N04
|
This example illustrates how to project an Annotate data set
for use with a map data set. It labels the locations of Miami, 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 as the method that is used for the map coordinates.
This example illustrates how to use the same projection method for both data
sets.
| 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; |
| data cities(drop=state rename=(newst=state));
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 'b' newst 100;
if state=12 and city='Miami' or
state=25 and city='Boston' or
state=23 and city='Bangor';
newst+1; color='blue'; size=10; text='T';
position='5';
style='marker'; x=long*arcos(-1)/180;
y=lat*arcos(-1)/180; output;
newst+1; color='blue'; size=4;
text=' '||city;
position='6'; style='swissb'; output;
run; |
| data all;
set reflib.us48 cities;
run; |
| proc gproject data=all
out=allp
project=gnomon
polelong=160
polelat=45;
id state;
run; |
| data citiesp us48p;
set allp;
if state>100 then output citiesp;
else output us48p;
run; |
| title1 'Distribution Center Locations';
title2 'East Coast';
footnote j=r 'GR23N04 '; |
| pattern value=mempty repeat=49 color=blue; |
| proc gmap data=us48p map=us48p all;
id state;
choro state
/ nolegend
annotate=citiesp;
run;
quit; |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.