Exploring the differences in dynamic data through time

We often find ourselves exploring what interesting things can be found in data that changes through time. In recent blog posts about the Mobile World Congress (MWC), we have published a couple interesting experiments with temporal data. In the first, we showed how CartoDB could be used to map traffic in Barcelona.

image

The map was built to automatically update every 15 minutes through the day. In the second map, we show a fun visualization of credit card purchases in Barcelona during MWC compared to purchases over a similar period not during the MWC.During the development of the second example, we realized how important it can be to show two maps simultaneously, side-by-side. In the credit card transaction example, each map show the view what happened at a different point in time.

The side-by-side technique can be really useful. For example, here we have recreated the Barcelona traffic map, now showing the traffic during the start of MWC and the traffic exactly one week later. 

image

The utility of the side-by-side map example is that you can allow users to zoom and pan into areas of interest. While traffic may not appear immediately different, if you are driving in Barcelona, you may want to explore the map close to discover the intricacies and maybe learn how large crowds influence the flows in that city. These insights are already helping some CartoDB users to build data dashboards to support their missions of creating smart cities.

We feel that a lot of CartoDB users will find an easy to use dual map visualization helpful for telling stories about their data. For that reason, we have developed an example as an easy to use template in our templates library. Grab a copy and start using it immediately with your CartoDB data!

The Ides of John Snow

March 15th is more widely known as the Ides of March, and the day that Julius Caesar was assassinated in the Roman senate. However for those of us in the mapping, data visualization and Epidemiology March 15th is the birthday of John Snow, an English physician and a leader in the adoption of anaesthesia and medical hygiene.

John Snow

Considered one of the fathers of modern epidemiology, in part because of his work in mapping the 1854 cholera outbreak in Soho, London, with this possibly the earliest use of a geographic methodology in epidemiology.

Using a dot map to illustrate the concentration of cholera cases around a particular public water pump and using statistics to illustrate the connection between the quality of water sources and cholera cases, Snow gave birth to visual analysis using maps. Through his map, Snow was able to confirm that the Southwark and Vauxhaull Waterworks company was delivering sewage-polluted water to homes and leading to increased incidence of cholera.

While the basic elements of topography and theme existed previously in cartography, the John Snow map was unique, using cartographic methods not only to depict but also to analyze clusters of geographically dependent phenomena.

In order to celebrate John Snow’s birthday, we’re offering a 20% perpetual discount on all new John Snow plans with the code “happybdaymrjohnsnow“. Simply upgrade your free account and enter the code. This offer expires on March 16th, so be sure to act quickly.

Cheers!

How NewsBeast Labs Visualized Roe V’ Wade

image

The following post was initially published on the NewsBeast Labs tumblr, and comes to us via Michael Keller, senior data reporter at Newsweek & the Daily Beast.

Michael is a reporter, designer and programmer working on ways to create interactive stories that let readers see how they fit into the story and, in reader feedback stories, ways to see how readers lives have intersected with the story’s subject matter. What follows is a repost from their blog. 

Last month we published a package of stories marking the fortieth anniversary of the Roe v. Wade decision. It had a few moving parts but I’ll just go over some of them briefly here.

How it started

This summer you probably heard the story about the last abortion clinic in Mississippithat was threatened to close due to stricter state laws. Allison Yarrow, who sat across from me at the time, was covering the story and it got us thinking: the line “The Last Abortion Clinic in Mississippi” is attention grabbing, but it doesn’t tell the whole story. That is to say, what you really want to know is how far are people away from their nearest clinic, regardless of state boundaries. One state may have five clinics but if they’re all in the southwest corner of the state and you live in the northeast corner, and your adjoining states have multiple clinics but only at their borders farthest from you, then you’ll have a hard time getting to a clinic, even if you had many in your state. To see where this might be the case and where access to services was compounded by new restrictive provisions (over 150 nationally in the past two years) we made as close to a comprehensive database as possible of every abortion clinic. Our goal was to see what parts of the country were farthest from a clinic. From start to finish, this process took about six months. 

We got our address data from a variety of publicly available sources: Planned Parenthood, the National Abortion Federation, anti-abortion websites that keep their own lists and others. We needed to verify that the address information was correct, though, so we called over 750 clinics to confirm. We also asked them up to how many weeks they offer services. The resulting database is the only one of its kind that we know of. The Guttmacher Institute undertook an abortion provider census in 2008 but they didn’t separate clinics from hospitals from private doctors offices, which represent different levels of care that we thought was an important distinction.

What it became

We started this in July and the project evolved. We thought the election might bring the issue of abortion access to the fore but it didn’t and that gave us more time. Allison brought up the fortieth anniversary of Roe v. Wade and that let us think much bigger about the project. Because this was such a personal subject matter, we knew readers’ comments would feature prominently (from both sides of the issue) and we wanted a strong narrative component, too.

To give a human voice to the Geography of Abortion Access map, Allison flew to Wichita, Kansas, one of the areas that stood out both on our map, as a metro area far from a clinic, as well as in recent memory as the site of the 2008 murder of late-term abortion provider George Tiller. To add a broader perspective, Sam Register who runs the Newsweek Archivist tumblr went through the Newsweek archives so people could follow the topic’s coverage from the 70s through the 00s.

What we learned from reader’s stories

Over the course of the week, we shifted the question we were asking from why do you support or oppose legal abortion to a conversation about pro-life and pro-choice labels as a way to get more nuanced opinions and show the complexity of the issue. We asked readers to complete either the phrase “I’m pro-life but…” or “I’m pro-choice but…” We got more responses from our other reader-based projects but we were happy in how thoughtful and honest people were. Read our roundup of interesting responses to those questions as well as our free form “Tell us your story” prompt here.

Under the hood on the map

How to represent this dataset was tricky. We had three main issues: anonymity, unbiased geography, and context. 

Anonymity: Although we got our data from publicly available websites that anyone could find and was often information that anti-abortion groups already held, we weren’t comfortable publishing addresses, names, or exact latitudes and longitudes. We took great care to do things like scrub our final database of anything identifiable and we partially randomized each clinic’s location so they weren’t pinpoint-able from our map. On the presentation level, we added the magenta circle big enough to span multiple hexagons (our base geography layer) to let people know that an address was approximate. Even if you backtrack and find our database, you won’t get any information that would let you de-anonymize the data.

Unbiased geography: As I wrote above, we wanted to get away from the arbitrary state and county borders that most all of the research we encountered was based on. We did some initial plots using Census tracts but that presents exactly the same problem [photo]. We ended up making a hexagonal grid using the Repeating Shapes plugin for ArcMap, which lets you make a grid out of your choice of shape and size. The trick to making a hexagonal grid for the web so that the hexagons will be regular (all sides equal) no matter what degree of latitude they fall on is to make the grid in your output projection, Web Mercator EPSG: 3857. You can reproject it to do your analysis in whatever you like, but because it will eventually be displayed in Web Mercator, it will need to be created in that so as not to come out distorted in the browser. If you want a 20,000 meter in diameter hexagonal grid, here’s the one we used:  ShapefileKMLGeoJSON.

And here’s another one that Brian Abelson, current Knight-Mozilla Fellow at the New York Times, made while he was helping out on the project. They are also 20,000 meter hex grids. This one has the state borders preserved in case you want to assign state values to each hexagon: ShapefileKMLGeoJSON.

Context: Generating our distance map wasn’t enough to tell a story with. We added three other pieces of information that would walk people through the significance of the patterns they were seeing. The first was a map of female population aged 15-44 so that people could see the areas where women lived that were farthest away from clinics and identify significant metro areas (the pink dot density overlay). The second was the different legal restrictions that each area was subject to (areas with highlighted transparency). Again, this was an interesting way to visualize this data because we didn’t highlight every hexagon in Kansas, for example, to show that certain laws were applicable in Kansas. Instead, we highlighted hexagons whose closest clinic was in Kansas. This gave us a very realistic map so that people could see what state laws they would be subject to if their nearest clinic was across state lines. It also visually demonstrates how state laws can affect people that don’t live in that state. And third, we selected our own highlights from going through the data, such as the areas where telemedicine is banned in conjunction with mandatory in-person counseling. The combination of these laws in Arizona, for instance, means some women travel over a hundred miles and spend two days to get a prescription for the abortion bill. 

More under the hood

The map itself we built using CartoDB, which allowed us to very flexibly add the different highlighted views of the map without rebaking our tiles each time.The slider that shows clinics that only offer services up to X weeks we did by loading four tile layers on top of each other at once and show/hiding them depending on the slider value. This made the map slightly slower on initial load but it made the transitions between map states super fast — so a trade-off. 

For the highlighted states, those restyle and reload all four map layers as well. We used Leaflet.js’s ability to plot vectors to draw the line between the hexagon you’re hovering over and the closest clinic to provide some more descriptive interaction.

A few months ago we spoke with Andrew Hill, Senior Scientist at Vizzuality (who makes CartoDB) on some experimental ways to map the data. The line on hover came out of some of his renderings and you can see in the photos below some of the experimental line styles.

All in all it was a lot of team work, Allison, Abby, Brian, Caitlin, Lizzie, Sam and a number of other people all helped with parts of it over the course of six months. If you have any other questions about it, let me know at michael.keller@newsweekdailybeast.com

-Michael

Before we settled on the Value-by-alpha approach for showing the different state laws, some failures:

We tried outlining the different shapes and showing them in different colors:

We tried coloring the hexagon outline by the different laws that were in effect. Creating a sensical hierarchy proved difficult:

Lines instead of hexagons:

Highlighting Peurto Rico:

A value-by-alpha chart where census tracts are shaded by their percentage of women of reproductive age. Unfortunately, it’s not that intelligible and the heat map overlay is a much cleaner way of showing this relationship:

Before we made the hexagon grid, how the map looks if you use census tracts:

A CartoDB and BBVA visualization on the economic impact of the Mobile World Congress in Barcelona.

mwcimpact visualization

The economic impact of the Mobile World Congress conference in Barcelona is estimated to be in excess of 300 million euros, making it one of the city’s most important annual events. With over 1,500 exhibitors and 70,000 visitors from 200 difference countries transferring the city into the de-facto mobile communications industry capitol. 

In order to showcase the real economic impact of the MWC on the city, and utilizing Big Data technology, BBVA analyzed millions of credit card and terminal transactions over the course of a two week period.

Dividing the data into transactions from the week before, and week during the conference, we created a temporal visualization using HTML and Torque, and then showcased those same millions of transitions by local and foreign ones, topographically, over the City of Barcelona. The visualization is available at www.mwcimpact.com

We feel that this visualization serves as a model to the type of business intelligence applications that could potentially be built on top of CartoDB, and we truly hope you enjoy exploring it as much as we did building it. 

We’ll be at Mobile World Congress from February 25th through the 28th (Congress Square - Lower Level - Stand CS60) and would love for you to stop by. 

Edit feature properties directly from the map.

Open feature metadata window CartoDB

This is one of those features that has come directly from requests of our users. At CartoDB, we love your feedback and we love working to make your requests come to life.

One of the most powerful capabilities that CartoDB delivers is the ability to clean or create new geospatial datasets from scratch using the Map View. Sometimes you find a feature in an incorrect location, or maybe you use CartoCSS to style your features and find something obviously wrong; in these cases, it would be great to update data directly in the map. Now you can do it.

With the new feature editing modal window you are able to edit the properties of your data directly on the map. You only need to click on the feature you want to edit and then click the editing icon on the left-hand side.

This will open a modal window where you can update or add new content for any cell. After you change the fields you want, simply click Save and close and your data is written back to the table.

Click save and close to save your changes - CartoDB

This makes the map view a great data editing interface and we hope this improve your experience working with data on CartoDB. 

As always, we would love to know what do you think about this and keep sending us your feature requests!

Enjoy!

Every recorded meteorite strike on Earth mapped

Two days ago The Guardian Data Blog published a map about all meteorites that scientist have found. We help them creating a screencast on how to make  it. Since then we can see that it has become quite a hit! It is been linked from major sites like The Verge, Digg, HackerNews and of course The Guardian.

We promised, this map was done pretty quickly, checkout the screencast, and of course the map!

Introducing beautiful info-windows with image support

New header info-window template

By far one of the most popular feature requests we’ve received since launching almost a year ago has been more customizable info-windows. With the release of CartoDB.js, we made info-window customization easier than it has ever been, however, this still left a lot of our non-technical users out in the cold. However, we’re happy to announce that this is no longer going to be the case. 

From now on, CartoDB users will have access to new info-window feature that will allow you to display an image linked directly from an external URL, much like we did on our The Hobbit video recording locations map, and all this will be available from the info-window customization panel. 

In order to get this up and running, you’ll need to put your image URLs in a table column, and then use that column in the first position of the info-window field list. Displayed in the image below. 

Header Infowindows screenshot

Easy, right? We also highly recommend that you process your images and optimize the prior to putting them into your visualization as to improve the browsing experience of your visitors.

We hope you enjoy this brand new info-windows template.
Happy mapping! 

CartoDB won “Startup showcase” at the Tools of Change for Publishing conference

This past Wednesday we attended O’Reilly’s Tools of Change for Publishing conference in New York as a Startup Showcase final contestant, and on the following day we were informed that we had been selected as one of three winners.

The ten finalists, and even the semi-final twenty were all great projects with monumental potential in the publishing space.

As a company that is not centrally focused on publishing, being treated with such high regard in the community is not only a great honor to us, but we’re absolutely humbled by the amazing reaction which we received from the publishing and journalism community. It is a great demonstration of the flexibility of our product to match different needs on different sectors.

In order to acknowledge this, we have decided to offer a limited three month 10% discount code for this week only on all new paid CartoDB accounts. Simply enter the code “TOCCONPUBLISHER” when you sign up for a paid plan to receive the discount.

Thanks you all so much, and we look forward to seeing many more maps and visualizations built by the publishing and journalism communities in the months to come. Stay tune!

Add context and custom content to your maps with our publishing templates

Responsive cartodb publishing templates

The data in CartoDB maps are often better understood in the context of your own webpages and external sites. Up to now, this has been possible using the embed tool or using a little coding knowledge. However, as more and more users create visualizations of ‘biodiversity data’ or ‘real-time traffic information’ we feel it is time to go one step further. We are now providing a few templates that will help you go from CartoDB map to published webpage faster than ever before. 

We have prepared two responsive design* templates for you to start using today. The first is designed to add editorial, rich, textual content to your maps. The template allows you tell a story with your CartoDB map. The second template moves the textual content to a panel on the right side of the map, adding emphasis to your visualization. Both templates come in a dark and a light theme.

These templates are now live, and you can download them on our developer page  Download them, link to them, or fork them, and start designing your own. 

In the coming months, we will be adding additional CartoDB publishing templates. Hopefully, you also come up with some of your own and share those with us; we would love to create a community template showcase. 

And of course, we look forward to hearing your feedback and seeing your creativity at work!

Real time maps with CartoDB: Barcelona traffic

image

One of CartoDB’s more interesting functionalities is its dynamic rendering. When hosting your data in the cloud with CartoDB, your maps and visualizations have the possibility to automatically update. As you can imagine this represents a fundamental paradigm shift in the map making process where you no longer need to publish a static map and manually update it, inserted with CartoDB you publish it once with live data, and the visualization will perpetually update. 

A great example of this is a city’s traffic status map. A typical traffic status map will represent traffic density by coloring the streets different colors and as new data becomes available update the map dynamically. CartoDB shines in these types of use cases and we would like to show you an example. 

We took traffic data from the City of Barcelona’s Open Dara Portal, and then dynamically imported it into CartoDB. This data, and now henceforth the map, will automatically updates every fifteen minutes. 

Click on the image to check out the demo. 

image

To get this map running, we synchronized the external data using Google App Engine with CartoDB, and in order to get you started with live data and dynamic mapping, we’ve provided all source code for this visualization, along with detailed instructions on GitHub.

Dynamic rendering is at the heart of CartoDB, and is one of its more interesting functionalities, either for live queries, or like we’ve shown here, real time data. Paired with our mechanism for content distribution, using Amazon Cloud Front, we ensure that you’ll be distributing the most recent rendition of your maps and visualizations with the latest data and at maximum speed and scalability. 

Finally, we’ll be at the Mobile World Congress in Barcelona starting the 25ht of February showcasing this technology, so please stop by our booth to see how CartoDB can make this, and other cool maps.