I am creating a map of a single metro area with the data mapped at the zip code level. I downloaded the ZTCA tiger file from the census website. I want to annotate the map with the county lines. When I create the annotate dataset for the county lines the counties do not line up correctly to the zip code dataset. I was able to partially correct the annotate data by assigning the parallel1 and parallel2 values in the proc gproject for the county lines. But the lines are still shifted off to the right slightly. Is there a way to force the longitude values to line up like the latitude values? Here is the code to project the zip code map: data longlat; set smk.&filename(in=mine); if mine; x=atan(1)/45*x; y=atan(1)/45*y; x=-x; run; proc gproject data=longlat out=smk.map ; id zip; run; Here is the code for creating the annotate dataset that labels the zipcodes, maps the county lines, and labels the counties. options orientation=&orient; goptions rotate=&orient ; %annomac; %centroid(smk.map,zip,zip); data smk.anno1; length color $ 8 function $ 10 text $ 20; set zip; position='5'; xsys='2'; ysys='2'; when='a'; hsys='3'; text=trim(put(zip,5.)); function='label'; style='Albany AMT/bold'; color='blue'; if zip in (43202 43211 43201 43203 43205 43215 43210 43209 43206 43205 43222) then do size=.5; color='black'; end; else size=.75; keep position xsys ysys when hsys text function style color size x y; run; data county; set smk.county01(in=mine); if mine; x=atan(1)/45*x; y=atan(1)/45*y; x=-x; run; proc gproject data=county out=smk.counties01 parallel1=39.658156 parallel2=40.316822; id countyfp; run; data smk.anno2; length function $ 10; set smk.counties01; by countyfp notsorted; position='5'; xsys='2'; ysys='2'; when='a'; hsys='3'; if first.countyfp=1 then function='poly'; else function='polycont'; color='black'; size=2; keep position xsys ysys when hsys text function style color size x y countyfp; /* put _N_= county= first.county= function=;*/ run; proc sort data=smk.counties01; by countyfp; run; %centroid(smk.counties01,smk.counties02,name); data smk.anno3; length function $ 10 text $ 20; set smk.counties02; position='5'; xsys='2'; ysys='2'; when='a'; hsys='3'; function="label"; text=name; style='Albany AMT/bold'; color='gray'; size=2; keep position xsys ysys when hsys text function style color size x y name; /* put _N_= county= first.county= function=;*/ run; data smk.annotate; set smk.anno1 smk.anno2 smk.anno3; run; And finally the code to create the map. proc gmap data=smk.map map=smk.map all; id zip; /* matches values between response and map dataset */ choro &Var / anno=smk.annotate levels=10 range legend=legend1 /* response variable */ /* pattern/color levels */ /*nolegend */ coutline=black woutline=1; run;quit;
... View more