SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 756|回复: 1
打印 上一主题 下一主题

Annotate ad GMAP

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 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.
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2011-2-9 09:55:21 | 只看该作者

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.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-13 08:35 , Processed in 0.071641 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表