CartoDB MLB Birthplace Map

Finally, thanks to the brilliance of the CartoDB platform and abetted by the beautiful Stamen Design watercolors theme, I have a map that tracks the debut of thousands of major league ballplayers from 1871 to 2013 (2014 data will be added at a future date). This is one I’ve been cooking up for awhile, but couldn’t get to as a top priority, given that it required some late night time fixing geo codes for hundreds of towns in places like the Dominican Republic, Puerto Rico, Japan, and Venezuela. All that was finally completed, giving me a dataset with a high degree of integrity – probably 99% accurate.

Have a look at the finished map – going to full screen mode will let you appreciate it even more:

This is the first in what could become a series, as the same information could be displayed in a variety of other formats such as bubbles, choropleth (filled maps), or clusters.

What to say about CartoDB? It’s absolutely brilliant in both concept and execution, and the founders seem willing to make strategic modifications on the fly. For now, I’m working with the free version (limited data capacity), but in time, may want to step up, given the capabilities of the software.

Here’s a look at what I’m talking about, so you can get a feel for the user interface – very clean and easy to navigate. First, the entire window for the current project:


CSS styling is also available for those wishing to tweak their maps, with the wizards providing the initial styling:


You can even limit your data using the available SQL window, a great option for users (like myself) who are well acquainted with SQL:


Finally, a simple toggle at the top of the window lets you move seamlesly between the map and data views. Here’s a quick look at the data for this project:


I should mention that working with the data is just as easy as styling the map or using the wizards. I have been able to quickly change string values to dates, and to geo-reference the data using the latitude and longitude fields in my text file. Anyone with experience working with Excel or any number of database platforms knows that converting field types is often very challenging, and sometimes comes with the risk of losing the data in that field. Not so with CartoDB, as it easily converted the date values to timestamps suitable for the torque (timeline) mapping wizard.

You should be seeing more work from me using CartoDB, and it won’t be limited to just baseball data.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Birthplace Mapper Update

Cool map alert!

For those who don’t know, mapping is cool!. Realized this for the umpteenth time as I finally got back to the player birthplace mapper I premiered a few weeks back. After a few hours wrestling with SQL code, and then overcoming a brain cramp on a data formatting issue, I think I’ve managed to get a 99% solution, with a high level of wow! factor thrown in. The remaining 1%, by the way, concerns some players who were apparently born in the ocean, at least according to the geo coordinates in my possession. I’ll get those fixed shortly, but in the meantime, have a look at the improved mapper.

Some of the missing pieces from my first run at this have been repaired – players born outside the US now have information that pops up when you mouse over their map marker. This is a major improvement over the hundreds of blanks the original attempt contained. The info boxes are also tied to the level of information available, thanks to the aforementioned SQL. There were no fewer than 16 combinations of available and missing information across country, state, city, birth year, debut, and name fields in the database. This makes for a rather interesting bit of database code, but you need not worry about that when you view the map. That headache belongs to me!

Kudos again to the Cloudmade project and its flexible mapping offshoot Leaflet. These apps are highly recommended for creating flexible, professional looking maps using GeoJSON (KML works too) and javascript. The speed and interactivity of these maps is spectacular, and there are many features I haven’t even figured out yet. Watch out when that happens!

.A final thanks for the inspiration and clustering approach (the cool stuff that happens with the markers when you zoom in or out) to Dave Leaver, who created the original map using this approach.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather

Birthplace Mapper – Work in Progress

After turning to Google Earth, I wasn’t pleased with the results, so I came back to Leaflet, worked a bit harder to figure it out, and found a great implementation to inspire me. My in process example is here – birthplace mapper. What this example does is to cluster the birthplace markers based their geographic proximity, separating and re-clustering them as you drill up or down.

This is really early in the process, as I plan to add more information to the markers, as well as fixing the ones that don’t currently display – mostly from outside the US, where state information may be absent. Still, the potential for this is high, and makes for a much better navigational experience than the Google Earth version I was working on. Try it out!

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather