Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

The detailed description will go here...

See the following toolpool paper for some good general info
on how to use the census zipcode boundary maps...

 Zipcode Boundary Maps!

Use the following to import the map...

proc mapimport
 datafile="./zt37_d00.shp"
 out=mymap;
run;

x/y is really long/lat degrees, so converted them to radians,
so I can gproject them...

data mymap; set mymap;
  /* Convert long/lat to radians */
  x=atan(1)/45 * x;
  y=atan(1)/45 * y;
run;

Assigned unique segment values to avoid stray lines between disjoint
3-digit zcta's...

data mymap; set mymap;
segment=(100*ZT37_D00_I)+segment;
run;

Project the map (note the use of 'eastlong'!)

proc gproject data=mymap out=mymap dupok eastlong project=robinson;
 id zcta;
run;

Then, I created some response data.
I started with numeric zipcodes (target_zip), so that I could merge
my data with sashelp.zipcode (which has numeric zip's), so that I 
could get the city name for each zipcode.  I later convert the numeric
zipcode to character, so it matches my map data set using "zcta=trim(left(zip))".

I add some html charttips with the city name & zipcode (in the 'myhtml' varialbe),
and also set up href drilldowns.  I mostly did this so users get a 'hand' when 
they mouse over the areas, so they'll know there is a charttip in the area as well.
Without the drilldown, the cursor doesn't change, and sometimes users don't 
notice the areas have charttips.

Then I plot the data using gmap, as I would any other SAS/Graph map data set :)

Back to Samples Index