Procedure features: |
PROC GPROJECT options:
|
ID
statement |
|
Other features: |
CHORO statement |
Annotate data set |
|
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.
|
goptions reset=all border; |
|
data us48;
set maps.states;
if state ne 2 and state ne 15 and state ne 72;
if density<4;
run; |
|
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; |
|
data all;
set 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 "GPJANNOT "; |
|
pattern value=mempty color=blue; |
|
proc gmap data=us48p map=us48p all;
id state;
choro state
/ nolegend levels=1
annotate=citiesp;
run;
quit; |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.