BookmarkSubscribeRSS Feed
CathyB
Calcite | Level 5

Using the excellent instructions recommended in Proc GMap County and State Boundaries" responses, I created a map with heavy state boundaries and lighter county boundaries.

 

Then, I used the instructions found in this document https://www.lexjansen.com/nesug/nesug03/bt/bt005.pdf to create a colored chrono map with select counties in various colors.  

 

However, the results are a mish mash of dark and lighter lines. The appropriate counties are correctly colored.

 

proc gmap map=AdaMap data=AdaMap anno=State_outline;
id state county;
choro segment / levels=1
nolegend
coutline=grayaa;    *Light grey county lines;
run;

 

* Create st/co fips var in Map dataset and data dataset for matching;
data AdaData;
set AdaData;
FIPS=cats(W_StFIPS,"_",W_CoFIPS);
put FIPS=;
run;

 

data AdaMap;
set adamap;
FIPS=cats(State,"_",County);
put FIPS=;
run;


/* Preparing for the chrono map */

proc format;
value Workers_fmt
0-25 = '1 to 25'
26-50 = '26 to 50'
51-100 = '51 to 100'
101-200 = '100 to 200'
201-500 = '201 to 500'
501-1000 = '501-1,000'
1000-500000 = 'Over 1,000'
;
run;

 

* fill patterns for the map areas;
pattern1 v=s c=pab;
pattern2 v=s c=grpb;
pattern3 v=s c=mogb;
pattern4 v=s c=mopb;
pattern5 v=s c=grb;
pattern6 v=s c=papb;


* create instructions for legend location and appearance;
legend1
origin=(5,10) pct 
mode=share 
across=1 
label=none
value=(j=r) 
shape=bar(3,4) pct;  

 

proc gmap
data=AdaData 
map=AdaMap (where=(density lt 6)) 
all;
id FIPS; 
choro workers / discrete
legend=legand1; 
format workers workers_fmt.;
note ' Ada Map Data set' 
j=l ' Ada County Outbound Commuters';
run;
quit;

 

 

Here is my code. (Previous code creates the state/county map, and the following creates the colored chrono map.)

 

 Where am I going wrong?  Is there an order of procs I'm overlooking that will annotate the state outlines on top of the colored choro map?

......

proc gmap map=AdaMap data=AdaMap anno=State_outline;
id state county;
choro segment / levels=1
nolegend
coutline=grayaa;    *Light grey county lines;
run;

 

* Create st/co fips var in Map dataset and data dataset for matching;
data AdaData;
set AdaData;
FIPS=cats(W_StFIPS,"_",W_CoFIPS);
put FIPS=;
run;

 

data AdaMap;
set adamap;
FIPS=cats(State,"_",County);
put FIPS=;
run;


/* Preparing for the chrono map */

proc format;
value Workers_fmt
0-25 = '1 to 25'
26-50 = '26 to 50'
51-100 = '51 to 100'
101-200 = '100 to 200'
201-500 = '201 to 500'
501-1000 = '501-1,000'
1000-500000 = 'Over 1,000'
;
run;

 

* fill patterns for the map areas;
pattern1 v=s c=pab;
pattern2 v=s c=grpb;
pattern3 v=s c=mogb;
pattern4 v=s c=mopb;
pattern5 v=s c=grb;
pattern6 v=s c=papb;


* create instructions for legend location and appearance;
legend1
origin=(5,10) pct 
mode=share 
across=1 
label=none
value=(j=r) 
shape=bar(3,4) pct;  

 

proc gmap
data=AdaData 
map=AdaMap (where=(density lt 6)) 
all;
id FIPS; 
choro workers / discrete
legend=legand1; 
format workers workers_fmt.;
note ' Ada Map Data set' 
j=l ' Ada County Outbound Commuters';
run;
quit;

 

My ultimate goal will be to superimpose directional arrows from the source county to the commuted-to counties.  If anyone has done something similar, I would like to know how it was done.

 

Thanks to all.

 

Cathy

 

 

1 REPLY 1

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 935 views
  • 0 likes
  • 2 in conversation