标题: Annotate ad GMAP [打印本页] 作者: shiyiming 时间: 2011-2-6 22:34 标题: 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;
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;
***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.作者: shiyiming 时间: 2011-2-9 09:55 标题: Re: Annotate and GMAP Actually, it is very simple. The reason for te the repeating of labels for each county is because there are more than one lebels in the annotate dataset for each county.