Map of the Week: Doughnut Holes in international waters

We welcome Dmitriy Skougarevskiy who is a doctoral candidate at The Graduate Institute of International and Development Studies in this guest post to let him tell us about his pet project on the loopholes in the Law of the Sea, called donutholes.ch.


It all started with an International Law volume where I glimpsed this illustration:

Source: Cook, Peter J., and Chris M. Carleton, eds. Continental Shelf Limits: The Scientific and Legal Interface. Oxford University Press, 2000, p. 317

Simply put, the 1982 U.N. Convention on the Law of the Sea established that an area stretching 200 nautical miles from a seashore is an Exclusive Economic Zone (EEZ) of the respective state. In practical terms, this convention is important as it grants the state an exclusive right to exploitation of marine life (think fishery) and natural resources (oil and gas).

But what if (a) littoral states are closer than 200 miles (how would they divide the sea?); (b) coastal shelf extends 200 n.m. from the coastline (when would the EEZ end?). An exciting legal loophole emerges when you combine these questions. The figure above shows two states with such seabed profile that area beyond 200 n.m. belongs to neither of them. Who owns this area then? International Law is unequivocal: this is international waters.

Such areas, shaped by nature and human convention, are known as ‘doughnut holes’. And they deserve to be mapped and explored: EEZ wiki page does not illuminate the unique legal-geographical interface they create. Maps in law books are an improvement, but they are static and secondary to the legal reasoning. Luckily, we have CartoDB to tell the story. To make a powerful statement, I need my interactive map to focus on the sea rather than land, showing state borders most people have never seen before. Apparently, CartoDB.js + Mapbox can create quite involved in a series of simple steps.

Bathymetry on base layer

Unless you are from the Wall Street Journal, your map starts with a baselayer. CartoDB offers a selection, but they emphasize land rather than sea. I want my story to unravel in layers, so showing the ocean floor is crucial. Natural Earth provides a beautiful raster image:

(this is the ocean bottom for the first image, in case you did not recognise it)

The easiest way to create your own baselayer for a CartoDB map is to use TileMill. With a bit of CartoCSS magic (the code is available on my GitHub) we get this:

I coloured the ocean, added continents and country borders. Also, I decided to add a touch of green to urban areas in countries. Note that I haven’t added any labels yet - CartoDB will do it. The resulting raster was exported into tiles up to the sixth zoom level (taking 168MB) and uploaded to my Mapbox account. This way, your map tiles are now served from the cloud where CartoDB can access it. So I linked my CartoDB visualization to my Mapbox baselayer with the ‘add yours’ button:

(note that now you will be charged both by Mapbox and CartoDB as the latter requests the former).

Drawing EEZ polygons

The story is all about exclusive economic zones. Therefore, I need accurate and up-to date boundaries. The Flanders Marine Institute offers a very detailed ESRI shapefile that shows both the World EEZs as well as the disputed areas and joint regimes. It is very meticulous and large. Feeding CartoDB a 154MB shapefile will fail unless you have an enterprise account. I dissolved and simplified the polygons in QGIS and mapshaper, reducing the shapefile to 1.8MB. Importing this shapefile to CartoDB is a matter of dragging a zip file with your .dbf, .prj, .shp and .shx files into your Dashboard. Provided that you have an informative .dbf, the attribute table will be populated automatically.

The loaded shapefile and baselayer will give you this:

Great, I can see the doughnut hole (and the Cuban EEZ), but the colors are all the same! CartoCSS comes to rescue. My attributes table has a ‘color’ column that ranges from 1 to 16. Each integer indicates a distinctive color that I manually assigned to each EEZ (Four-colour theorem won’t work here because of the non-contiguous overseas territories). So assigning colours now is a matter of writing the conditional CartoCSS:

However, a cursory look at the South China Sea reveals numerous disputed EEZs:

Source: The Economist

How one should colour them? I chose to use stripes: if the dispute is between a yellow-color EEZ and an orange-color EEZ, the contested area will be filled with . My CartoCSS would then specify:

for each disputed area.

Telling the story

Now that I have EEZs mapped on top of the seabed, it’s time for doughnut holes to speak up. Each loophole has its own dramatic story to share, so I create a second layer in my visualization, which is linked to a simple attributes table:

Each row is a donut hole with its point-wise location (the_geom), name, description and sources used in the description. I style a custom infowindow:

Note the triple mustache in ‘{{{description}}}’ and ‘{{{sources}}}’. This will render the html tags in table cells: The resulting infowindow

If you use the double mustache, all the tags will appear as plaintext in the infowindow.

Interactivity

The user should always know the EEZ sovereignty. Javi Santana developed a nice geometryhover() function I’m using to display sovereign name on hover and emphasize the borders:

Some would also love to explore the complex ocean floor that shapes the doughnut holes. This can be done by setting the #eez [zoom>=0]{polygon-opacity: 0;} on button click. With jQuery UI, it goes along these lines:

This code uses setCartoCSS() from CartoDB.js to style the polygons with a given CSS. Finally, the impatient few might want to jump from one doughnut hole to another, so I provide the list:

Clicking on each item will zoom the map there with the aid of the following jQuery UI + CartoDB.js:


We’ve come a long way from a paper map to an interactive web application you can explore at http://donutholes.ch.

Heartbleed/OpenSSL vulnerability

Probably you have heard of Heartbleed already so we will keep this short. This is what what we did at CartoDB the following hours after the issue was announced (By Tuesday, April 8th 2014 at 11.00 UTC all our systems were free of this vulnerability)

  • We patched all our systems with a fixed OpenSSL version
  • We re-issued all our HTTPS certificates
  • We logged out everybody from their accounts

We don’t have any evidence that this vulnerability has been exploited in our services. However, because of the nature and importance of this specific vulnerability we strongly suggest that you change your CartoDB credentials, your password and your API keys. You can do this under “Account settings” once you log in to your account.

If you have any question, please, contact us at support@cartodb.com

Interesting CartoDB profiles

As part of the launch of the new CartoDB Public Pages we are proud to introduce you to some amazing Public Pages from great CartoDB users. If you want us to showcase your pages, ping us at stories@cartodb.com or tweet @cartodb!

LifeWatch INBO

LifeWatch INBO is a biodiversity initiative in charge of several terrestrial and freshwater observatories. They use CartoDB to visualize and analyze the movements and paths of birds and other animals. Check it out at lifewatch-inbo.cartodb.com. Also, don’t miss LifeWatch INBO’s site.

Twitter Data - Simon Rogers

Simon Rogers is the data editor at Twitter, and was the creator of The Guardian Datablog. In his CartoDB Public Page srogers.cartodb.com you can find all the amazing visualizations of Twitter activity he has created.

Geoplex

Geoplex is an australian CartoDB partner, creators of amazing tools like TripRisk or realestate.com.au/invest. Check out all their visualizations at geoplex.cartodb.com

Create your Public Page today

If you already are a CartoDB user you can start showcasing your work in your CartoDB Public Page today. Remember that by default all previous content is not listed in your CartoDB page. But its easy to start building your page! You just have to select the visualizations and tables you want to have listed in your Public Page. Its as easy as changing the privacy feature:

(our free users remember: once you select that a visualization or table become listed, you can’t go back unless you upgrade to take advantage of the full privacy options ;)

And if you are not yet a CartoDB user, what are you waiting for? Start visualizing your data today.

New Public Pages in CartoDB - discover great maps and visualizations by enthusiast users and organizations

What are the New Public Pages

We are thrilled to announce the new CartoDB Public Pages. The new Public Pages enable a profile for you or your organization with an easy to remember URL accessible by anyone, showing all your public visualizations and data. The new Public Pages live at {yourusername}.cartodb.com.

Up until now, you were able to share your map with a URL or embed it on your website, but it may have often been difficult to find that URL if you didn’t save it. There was also no way to list all your visualizations and data tables. Now, you have your own public profile in which all your public visualizations and data are listed. They are easily browsable and discoverable by anyone. Think of it as your Twitter page, which lets people discover all your tweets and interact with you.

New Public Pages opens up a world of possibilities

Being able to browse a user’s or organization’s visualizations and data opens up a great deal of possibilities. From inspiration and ideas to collaboration, the new Public Pages makes it super convenient to easily interact around a given visualization: comment on it, share it, republish it on your site and more.

You can also access the raw data tables that were used to build a visualization. This is a feature we love: if someone is sharing their data, you will be able to just upload it to your CartoDB account and start creating your own visualization from that point. If you filter, improve or edit the data, you will also be able to share this modified version of the data, starting the cycle again. Many people and organizations work with open data in CartoDB, so this will improve the pace at which you are able to share, remix, and reuse open data for your geospatial projects.

In the coming weeks we’ll be adding new ways to discover and explore visualizations and content.

Controlling what appears on your Public Page

If you are a paying user, you can easily set the privacy settings for each of your visualizations and data tables. Your already created content (visualization or table) will not be shown in your public profile by default. You can easily access your visualizations and tables and choose to show them publicly.

When creating new content, you will be able to select the privacy level you want. If you are creating your visualization to share with the world, just leave the default to share it in your public profile. If your visualization is for internal or private collaboration, you can just change the privacy setting.

Public on the web means it will be listed in your public page. Anyone with a link means it will not be listed in your public listed, but will be accessible to anyone who gets the link.

For our free accounts, all content (tables and visualizations) created prior to April 7th 2014 will not be listed in your public profile (although they remain accessible if someone has the URL, as they always have been). You can easily access your visualizations and tables and choose to show them publicly. But beware, once you select that a visualization or table is publicly listed, you won’t be able to go back ;)

Tables and visualizations that you create from now on will be listed in your public profile. So if you are publishing sensitive content that must remain private, remember to upgrade your account.

What changes

The URL for your new public profile is {yourusername}.cartodb.com. You may have been using this URL as the way to access your private dashboard. Now, this URL will show different content, but you will have a link in the header of this new page to easily access your private dashboard. (Although if you are power user of CartoDB, chances are that the complete URL for your dashboard is remembered in your browser’s history!)

Stay tuned for more improvements on this (and many other) fronts! If you aren’t already a CartoDB user, you can start your free trial and create amazing visualizations with your data. And you can start building your CartoDB profile, of course.

Mapping food banks in Spain with CartoDB

We welcome Dani Latorre in this guest post to let him tell us about a little project in which he has used CartoDB as part of the development. Stay tuned for more stories like this, and if you want, just write and tell us your stories@cartodb.com


A couple of months ago I decided to look for information about food banks in Spain. After wasting a couple of hours searching, I found only information at FESBAL website (Federación Española de Bancos de Alimentos). But my objective was to collect all the information about food banks whether they were of that federation, religious organizations or totally self-managed organizations.

I don’t like charity, recently I read a Eduardo Galeano quote: “Unlike solidarity, which is horizontal and is exercised as equals, charity is practiced top-down, humiliates the recipient and never alteres one bit of power relations”. Agreeing with this quote and looking that government solidarity is low at this moment, it’s more important that someone can have a plate of food even for charity.

So I thought about putting my two cents in this front, creating a little project to map all food banks in Spain. CartoDB seemed the right tool for the job. And indeed it was! In less than 2 hours I had the raw data, I had done the map and I finished the integration with the website developed with Sinatrarb.

Let me walk you through the process.

Getting the data

I started developing a web scraper for FESBAL website with Python (using Mechanize and BeautifulSoup) to generate a CSV file with the raw data to import to a CartoDB table.

Importing the data into CartoDB

In the CartoDB dashboard I created a new table importing the CSV data file. Once imported I used CartoDB’s georeference tool to automatically georeference using the food bank’s addresses (I had to add some latitudes/longitudes manually for a few rare addresses).

Styling my visualization

After that I created the visualization from that table and played with visualization wizards. Select map marker styles, infowindows content, map tiles…

Once I finished the visualization, I embeded it on a little website created with sinatrarb, using Foundation CSS for the layout.

Using CartoDB.js

The web is also integrated with CartoDB, using SQL API to show all the food banks in a simple list and to allow visitors to add more food banks. In my opinion it’s a powerful API if you have a minimal knowledge about SQL and to handle JSON responses.

In the list only georeferenced food banks are being shown. I’m not showing those who are not yet georeferenced; so I’m using this mechanism to moderate submitted content until it gets reviewed and georeferenced.

Even if you don’t know much about Ruby, the code is pretty self explanatory:

Adding new food banks is also quite evident with a minimum knowledge of SQL, as shown in this code snippet:

bancosdealimentos.herokuapp.com

The web can be seen in bancosdealimentos.herokuapp.com, scraping and Sinatra application code are available for free use on my Github account.

CartoDBeers: Satellite data - from processing to visualization, with Chiara Solimini

New edition of CartoDBeers! Our informal gatherings in our office to talk maps, visualization and tech. This time we are proud to welcome Chiara Solimini. Chiara has been working with the European Space Agency proccessing earth observation imagery and data to creatively visualise scientific results.

Chiara will talk about her experience followed by a Q&A session, and beers, of course. Don’t miss it: Next Tuesday April 1st in our Madrid office (C/ Eloy Gonzalo, 27). Just come by! We’ll start at 19.00

More about Chiara: Chiara Solimini worked as on-site contractor for ESA/ESRIN in Italy for more than 4 years, supporting European Space Agency (ESA) to communicate Earth Observation (EO) scientific and application results. She was creating the Image of the Week (IOW) published every week in the ESA website as well as videos and animations illustrating ESA’s EO missions achievements. Her role included the processing of all the different EO imagery and data source to creatively visualise scientific results. The processing involved the use of satellite data dedicated software, digital imaging software, compositing and video editing apps. Developing “ad hoc” routines for EO data analysis was also part of her task. Chiara holds a PhD degree in GeoInformation from Tor Vergata University of Rome.

During her stay in USA she participated to a competition “Art in Science| Science in Art” and her image was exhibited in the New York Hall of Science from February 2009 to June 2009. Three of her processed Images were selected from National Geographic as one of the Best Space Pictures for the year 2009, 2011 and 2012. One of her processed image has been used by the rock/indie band Alt-j as cover for the album “An Awesome Wave”, in 2013.

Chiara is currently working on her artistic and scientific projects.

CartoDB Climate Grants to give up to $3500 to nonprofits working on climate change

In June 2013, the President of the United States announced the Climate Action Plan,an effort cut carbon pollution, prepare communities for the impacts of climate change, and lead international efforts to address this global challenge.

Delivering on a commitment in the President’s Climate Action Plan, the Obama Administration is today launching the Climate Data Initiative, an effort to leverage data to help the American people understand and prepare for climate change. The initiative is aimed at advancing environmental science, preparedness, and education through the use of open data. The goals of the initiative are closely aligned with the core mission of CartoDB, to promote and enable people to make a better world through understanding of data. It is because of that alignment that we have decided to go a step further. Today we are launching CartoDB Climate Grants, an exciting new program to promote some of the world’s most important mapping projects.

CartoDB Climate Grants will be giving grants between $50 and $3,500 to organizations doing really important work for our world. The Climate Grants program really springs from something we have always wanted to do, put CartoDB into the hands of the people we believe in. Through CartoDB Climate Grants, we hope organizations succeed in building data visualizations and applications to help educate and improve our understanding of climate change. In coordination with the Climate Data Initiative, we think we can empower more people to create tools and visualizations that will educate and create change.

Some of you may not know our history, but CartoDB is the product of our company, Vizzuality. At Vizzuality, we worked for a long time on the idea that data, science, and the challenges facing our environment could be better addressed through data communication, mapping, and better user-engagement through the web. So much of our projects relied heavily on the map. We eventually got the idea that if we built a product easy enough to use we could enable anyone to create beautiful and interactive maps on the web.

Our suspicion turned out to be true, so now with Climate Grants we can ensure that some of the most important projects are able to gain from our work. We feel that as our service grows and our user’s maps become more popular on the web, we can expand our offerings to those map-makers who need the CartoDB the most. We are going to be providing up to $3500 to successful applicants to use on CartoDB infrastructure. Applications are being accepted on a rolling basis, so if you think your project aligns well with our mission, head over to http://www.cartodb.com/climate to get details and apply.

Image credit: Beth Scupham

New color picker and new basemap

Two new small improvements this week (watch our for bigger ones in the coming ones!!).

New basemap

New CartoDB Basemap: Antique

Welcome CartoDB Antique, our new basemap, added to the collection of CartoDB Basemaps. A soft, elegant and simple antique-type basemap for your visualizations.

Improved color picker

New color picker options and revamped usability

With CartoDB’s authoring tool you can select the color for your point markers, polygons, text, etc. Up to now we offered a set of predefined colors. With this change, now you have our set of carefully selected colors plus the possibility of selecting any color from the new color picker, on top of being able to paste the HEX code of your color (or even write it if you are that type of person).

And this is not all: if you edit your CartoCSS, you also take advantage of the color picker, and of the previsualization of your color in the code. Just watch:

Color picker and color previsualization directly in CartoCSS

Don’t you love our #littlebigdetails?

CartoDB at CEBIT 2014

After a productive week in the MWC in Barcelona, we head over to Hannover to attend CEBIT, one of the biggest tech expos in the world. You’ll find us in Hall 16, Stand D30. We’ll be showcasing CartoDB’s technology and use cases, showing lots of the maps and visualizations created using CartoDB, such as the visualization of the Oscar’s night, tweets about the Ukrainian conflict, the Global Forest Watch project, our animated cumulative maps, and much more.

We are also taking part of CODE_n, CEBIT’s official awards in which CartoDB is a finalist among more than hundreds of participants. Will we win? The topic of this year’s awards is Driving the data revolution, something we are particularly good positioned to tackle.

If you want to assist to CEBIT we are giving away some tickets. Just ask for them in contact@cartodb.com - And if you want to appoint a meeting so we can show you CartoDB, just ping us.

CartoDB at SXSW 2014

SXSW 2014

CartoDB will be at SXSW 2014 in the great city of Austin. SXSW has grown into the most amazing place to learn and listen to the latest ideas and technologies in the interactive arena. Javier de la Torre, CartoDB’s CEO, will be presenting in the panel Why Non-Profits Should Embrace Data Journalism, along with Becca Aaronson (The Texas Tribune) and Megan Kilgore (Capital Area Food Bank of Texas). Meet them next Sunday March 9, 3:30PM - 4:30PM.

You’ll learn why CartoDB is the perfect tool to develop your non-profit data journalism projects, and the easiest way to visualize your data in order to understand it and take decisions and communicate efectively. Check out our examples and case studies page to discover amazing CartoDB usages.

We’ll also be in the Spanish Booth (1119-1121) demoing CartoDB. If you want to meet us, ping us and lets schedule an appointment.

And the most important thing: don’t miss our friend Jesús BBQ party on Saturday, March 8, 4-8PM ;)

Stay tuned and subscribe to our mailing list

*We promise we'll never share your email address with anyone