Do you find yourself on the road during the holidays, and looking for a place to eat that's still open? Or perhaps you're like me - I don't cook at home, and I'm not really into visiting family for the holidays and eating with them. Well then, you probably know about Waffle House! It's a chain of small restaurants (or rather a diner with a grill) that's open 24 hours a day, every day of the year. The Waffle House even has a reputation of staying open during weather emergencies (see the Waffle House Index).

Since I've seen Waffle House restaurants everywhere I traveled, I sort of assumed they were 'everywhere' in the United States. But when I actually got to checking, I found that was not exactly true! It appears some states don't have any Waffle Houses! So I decided to look into this a little further...

Official Waffle House Map

The Waffle House website has a screen where you can view all the Waffle House locations on a map. The main purpose of their map is to zoom-in and search for locations near you. The zooming ability is pretty cool, but the US-level map isn't particularly useful. For example, they have bubbles with summary counts ... but those summary counts aren't by state (what are they by?!?) Here's a snapshot of their map:

Location Data

Being a map guy, and a Waffle House fan, I decided to take matters into my own hands, and try to create a better map. First, I needed the location data. I couldn't see a good/easy way to get all the locations from the Waffle House website, therefore I let scrapehero.com give me a hand with that. They provided a csv file with the street address and latitude/longitude of each location. Here's a glimpse of what the first couple lines of the csv file look like:

I used the following code to import the csv into SAS:

proc import out=my_data datafile="Waffle_House_USA.csv" dbms=csv replace;

getnames=yes;

datarow=2;

guessingrows=all;

run;

Now, with the data in a SAS table, it's much easier to read, and more manageable. Here's a peek at what the data looks like in SAS:

Map of Locations

For my first map, I decided to simply plot each of the locations as a dot, on a US map. Therefore I got a US polygon map and projected it in the way I wanted, and then also applied the same projection parameters to the Waffle House lat/long coordinates. I then used Proc SGmap to plot the data as red dots on a map. The map definitely shows a high concentration in Atlanta, GA (that's where the Waffle House restaurants first started).

proc gproject data=my_data out=my_data latlong eastlong degrees dupok

parmin=projparm parmentry=my_map;

id;

run;

proc sgmap mapdata=my_map (drop = lat long) plotdata=my_data noautolegend;

choromap / mapid=statecode lineattrs=(color=grayaa);

scatter x=x y=y / markerattrs=(size=3px color=red symbol=circlefilled);

run;

And speaking of Waffle Houses in Atlanta, here's a picture of one that my friend Margie took for me this morning (Dec 23rd). Looks like they've got quite a few customers, on this holiday week. Thanks Margie!

Map of Summary Counts

Next, I wanted to see how many Waffle Houses were in each state. Therefore I used SQL to calculate that summary count, and plotted the numbers as text at the centroid of each state:

proc sql noprint;

create table state_data as

select unique state as statecode, count(*) as state_count

from my_data

group by state;

quit; run;

proc sgmap mapdata=my_map (drop = lat long) plotdata=state_data noautolegend;

choromap / mapid=statecode lineattrs=(color=grayaa);

text x=x y=y text=state_count / textattrs=(color=red size=12pt);

run;

Map of North Carolina Locations

And since I live in North Carolina, I created one more variation ... this time showing just the NC locations on a tile-based street map.

proc sgmap mapdata=nc_map plotdata=my_data (where=(state='NC')) noautolegend;

esrimap url="http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map";

choromap / mapid=statecode lineattrs=(color=gray11);

scatter x=long y=lat / markerattrs=(size=8px color=red symbol=circlefilled);

run;

Of course, I left out a few of the details in the code above - if you'd like to see the complete SAS code, click here. (Per scrapehero's rules, I can't redistribute the csv data, therefore if you want to actually run the code, you'll need to obtain your own copy of the csv data from scrapehero.com.)

Questions

Do you like my US map better than the official Waffle House map? What other changes/additions would you like to see in the map? And where do you recommend eating out on holidays, and days when most restaurants are closed? Feel free to leave your answer in the comments section!