Hello, I am trying to create a county map for multiple states on one graphic. I have different style lines for the states and counties to give more emphasis to the states. My problem is that some of the county lines are being formatted like states. You can see what I'm talking about in the attached picture. /*******************************************************************/
/* This sample program produces a map of Arizona, Colorado, */
/* New Mexico, and Utah with thick state outline. */
/* You can change the width of the line by changing the value of */
/* the SIZE variable in the ANNO annotate data set. */
/* */
/* Since we are using an unprojected county map, we need to use */
/* the GPROJECT procedure to project the map data. Subset the */
/* specified states during the projection. */
/* If you include Alaska, you might want to use the GNOMON */
/* projection with the POLELONG option to better center the map. */
/*******************************************************************/
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create a projected map data set named MAP */
proc sort data=newmap;by state;quit;
proc gproject data=newmap out=map;
id state county;
/* Use the state FIPS codes to subset the desired states */
/*Pacific*/
/* where state in (6,41,32); */
/*Pacific - HI Only*/
/* where state in (15); */
/*West*/
/* where state in (53,16,49,4,30,56,8,35,38,46,31,20,40,48,27);*/
/*West - AK Only*/
/*where state in (2);*/
/*Northeast*/
/* where state in (19,55,17,26,18,39,42,36,50,23,33,25,44,9,34);*/
/*Southeast*/
where state in (29,5,22,21,47,28,1,54,10,24,51,37,45,13,12);
run;
quit;
/* Since we want to thicken the outline of the state boundaries, */
/* we need to get the coordinates for the state outlines. Using */
/* the GREMOVE procedure, we can remove the county boundaries to */
/* create a data set of only the state boundaries. */
/* Create a data set named STATES that contains the state boundaries */
proc gremove data=map out=states;
/* STATE is the new identification variable */
by state;
/* STATE and COUNTY were the original identification variables */
id state county;
run;
quit;
/* Increment the SEGMENT variable value for all lake coordinates */
/* indicated by missing X and Y values. */
data states;
set states;
by state;
retain flag num 0;
/* Reset the flag value for each state */
if first.state then do;
flag=0;
num=0;
end;
/* Set the flag value when x and y are missing */
if x=. and y=. then do;
flag=1;
num + 1;
delete;
end;
/* Increment the segment value */
if flag=1 then segment + num;
drop flag num;
run;
/* Use the Annotate Facility to draw the outlines for the states */
/* */
/* The data coordinate system of '2' is used for XSYS and YSYS to */
/* place the annotation on the map at the correct location. The */
/* WHEN variable is set to 'A' to place the annotation after the */
/* procedure output has been drawn. The color for the outlines is */
/* set to black. The size of the outline is set to 5. The color */
/* and size of the outlines can be changed by changing the values */
/* in the COLOR and SIZE variables, respectively. */
/* Create an annotate data set named ANNO for the state outlines */
data anno;
length function color $8;
retain xsys ysys '2' when 'a' color 'black' size 2;
drop xsave ysave;
set states;
by state segment;
/* Move to the first coordinate */
if first.segment then function='poly';
/* Draw to each successive coordinate */
else function='polycont';
output;
run;
/* Specify distribution format */
proc format;
value dist low--.10='large decrease' -.10--.03='moderate decrease' -.03-.03='no change' .03-.10='moderate increase' .1-high='large increase';
run;
/*http://www.devenezia.com/docs/SAS/sas-colors.html*/
/*title 'California Distribution';*/
/*title2 h=10pt 'By County';*/
pattern1 value=solid color=H07D74C3;
pattern2 value=solid color=H078B0FF;
pattern3 value=solid color=H000FF00;
pattern4 value=solid color=H0DDA1BA;
pattern5 value=solid color=H0DD476D;
/* Generate a county map with thick state boundaries */
proc gmap data=combinedproducts2 map=map;
id state county;
choro count / anno=anno coutline=H0784F00 discrete;
format count dist.;
label count='YTD Referral Performance';
run;
quit;
... View more