Thursday, July 30, 2015

National Parks

During #TravelMonth I managed to get in two new National Parks (Lassen Volcanic and Olympic). My son was quizzing me on which parks I have been to and I had the idea to come up with a viz about the National Park System.

The first tab is a story walking though some general info. There is also a storypoint about the units I have been to and on the next one you can see how many you have. Leave a comment below with your results. Other tabs have a explorer where you can pick from a map and details about the different locations.

I had to pull the data from all over. There are a bunch of reports from the NPS Reporting site but they are by park and I had to ETL them together. The images I pulled down from the Unit web pages with import.io.

Wednesday, July 29, 2015

Find a NPR Station

I have been traveling and forgot to do anything for #TravelMonth, so I will put a couple out that I have been playing with. This is the first.

I may be bucking the trend of my generation, but I don't listen to music in the car. I always listen to NPR though. The first thing I do when traveling to a new place and getting in the rental car is to figure out the local NPR affiliate and change the station.

I love maps, so tracking down and figuring out how to model all the FCC Data for the stations was fun. They have 360 coordinates to plot the ring of station coverage, so Tableau is having to plot 361 points for each station. This is why I decided to display one (my home state) to load. It is about a quarter million points for all of the US. Originally I was going to do it for all radio stations, but it was north of 6 million rows/points and was horendiously slow. I have that dataset if anyone is looking for it, let me know. The coordinates were in 17,000-ish individual KML files that I was able to ETL using Pentaho Data Integration into one dataset.

Dual axis maps are only doable in Tableau if you have the same lat/long field. In my case the station lat/long was different from the coverage area lat/long so I had to put the station info in the center of the coverage area, not where they actually are. That caused some wonkiness with some stations on a coast or border.

I really wish that Tableau would build in location awareness. There are so many ways this could help. Imaging a salesperson loading up a viz and it automatically filters to the state they are in, or clients in a x mile radius. For this example I would love to be able to have it zoom to where you are and then show stations that you can get. Instead I have to lean on the new map search or people manually filtering by state.

Monday, June 22, 2015

Great Lakes Deaths Due to Water Currents

I was sent this article today and the search tool they had built for this dataset was pretty rough to use, so I made a Tableau version.

Friday, May 8, 2015

More features for Tableau Public

Tableau Public just became more powerful. More details here. I have run into some limits before. Most recently with my snowfall viz. It has about 2 million rows of data, but Tableau Public only allowed 1 Million. Now 10 million rows are allowed so I just updated it with more historical data.


Wednesday, April 22, 2015

Trees of Ann Arbor

Today is Earth Day so I thought I would get out a dashboard of Trees from the City of Ann Arbor.

Some of the data was tough going until I figured out that the X/Y coordinates were an actual system. I had a background image of a map and was messing with scales until I discoverd the State Plane System. Then things went quickly and I got the data converted to Lat/Long and cleaned up and grouped.

Click the dashboard below to load


Sunday, February 8, 2015

Snow Tires: Worth It

We are in the depth of winter here in Michigan. It was a bit warm, but we got over a foot of snow this week and temps are going to drop again soon. I have been working on a couple winter themed viz for this week between taking care of a new baby and the rest of life.

I have had snow tires for a long time now, but people have misconceptions about them: You really just need all season tires. My car has 4WD/AWD so I don't need them. I don't have money for winter tires.

I haven't had a chance to play with storypoints much in Tableau, but being able to adjust the caption size in the 9.0 beta is a huge win. I just want more formatting and layout options like a bullet list on the side.

Wednesday, October 8, 2014

Almost time to change your clocks, but now is the time to change your data.

Daylight savings time is coming up and it causes havoc with most of us. It also causes issues with our data. Timezones, daylight savings time, and UNIX timestamps all combine to cause crazy calculations.

Machine data often is based on GMT (Greenwich Mean Time). This is handy because computers all have their clocks set to the same time. It's like in the USSR where all trains ran on Moscow time. The benefit is that it's easy to compare times, but for humans we get confused when it doesnt line up with our watches.

The first step we run into sometimes is that UNIX timestamps. These are integer values that represent the number of milliseconds since the UNIX Epoch Jan. 1 1970.

Daylight Saving Time (DST) is some weird thing we do twice a year because of something to do with farmers, energy saving, and traffic accidents. Nobody is really sure.

There are a couple of methods of calculating all of these, but here is goes.

To convert a timestamp you can do this:


DATEADD('second', [Unix timestamp], #1970-01-01#)  


Now you have a GMT date. To convert it to Eastern Time (EST) and account for DST you need to -5 or -4 hours depending on if it is in the DST range. To determine the offset you can use this calc:

//determine if date [Date (GMT)] is in normal time
if 
 (datepart('day',[Date (GMT)])-datepart('weekday',[Date (GMT)])<7 
  and 
 datepart('month',[Date (GMT)])=3)
or 
 (datepart('day',[Date (GMT)])-datepart('weekday',[Date (GMT)])>=0 
  and 
 datepart('month',[Date (GMT)])=11)

or datepart('month',[Date (GMT)])<3

or datepart('month',[Date (GMT)])>11

then [Timezone offset]  //if it's normal time add the timezone diff from GMT (-5 for EST -8 for PST)
else [Timezone offset]+1  //if it isn't normal time its DST so add the offset +1 (-4 for EST and -7 for PST)
end

I usually roll them up into two calcs one for the above TZ offset and then the below calc that converts the timestamp and adds the offset.


DATEADD(
 'hour',
 [TZ and DST offset],
 DATEADD('second',INT([Unix Timestamp]),#1970-01-01#)
)


Tableau also have KB articles and Forum Posts that cover this as well.

To see how it all shakes out we have a sample viz.

Also note that some of these adjustments would have to be changed a bit to accommodate places like Australia and Newfoundland that have half hour time zone variance.