|
楼主

楼主 |
发表于 2011-2-6 22:34:45
|
只看该作者
Annotate ad GMAP
Hi,
Sorry, I have no Chinese in this computer and have to use English. <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
I tried to label county names in the USCOUNTY map using the codes
below:
**to get the conty name from ZIPCODE file;
proc sql;
create table CNTY_Map as
select t1.county,
t2.countynm,
t1.x,
t1.y
from maps.uscounty t1, SASHELP.Zipcode t2
where t1.state=1 and (t1.state=t2.state and t1.county=t2.county);
run;
*************************
Create Annotate Dataset
*************************;
data cnty_label;
length function style $8 Position $1 text $20;
retain function 'label' xsys ysys '2' when 'a';
set yali.cnty_map(keep=x y countynm);
style='swissb';
text=countynm;
SIZE=0;
POSITION=8;
output;
RUN;
%_sas_pushchartsize(1400, 900);
GOPTIONS CBACK= ;
PATTERN1 VALUE=SOLID COLOR=CX000080;
PATTERN2 VALUE=SOLID COLOR=BLUE;
PATTERN3 VALUE=SOLID COLOR=CX00CCFF;
PATTERN4 VALUE=SOLID COLOR=CYAN;
PATTERN5 VALUE=SOLID COLOR=CXCCFFFF;
PATTERN6 VALUE=SOLID COLOR=WHITE;
PATTERN7 VALUE=SOLID COLOR=CXFFFF99;
PATTERN8 VALUE=SOLID COLOR=CXFFCC99;
PATTERN9 VALUE=SOLID COLOR=CXFFCC00;
PATTERN10 VALUE=SOLID COLOR=MAGENTA;
PATTERN11 VALUE=SOLID COLOR=RED;
***CMPPP is the file contain the response variable;
proc gmap all data=work.CMPP Map=Cnty_Map;
id countynm;
choro CMP_PP/ annotate=cnty_label discrete cdefault=white;
run;
quit;
Everything works fine except that the county names got repeated
several times for each county on the map. (I know that in the annotate file the
county names repeated due to the values of x and y. But annotate file
in the example from SAS seems contain more city names). Can sb help me
out. Thanks a lot. |
|