The CartoDB platform is designed for maps of all shapes and sizes. While we appreciate linearity, we understand that many visualizations tell stories that don’t follow a straight path. The following tutorial will explain how to introduce complex shapes into your projects with shapefiles.
What are shapefiles and what do they contain?
A shapefile is a common format for transfering geographic data that you see online. Shapefiles are actually collections of three or more associated files that come together to represent vector features, such as points, lines, and polygons, each with descriptive attributes like “name” or “temperature”. When imported into CartoDB, those attributes will comprise your table.
Files extentions necessary for shapefile import:
This file contains the primary geographic reference data and records of various shape types included, such as points, polygons, or multipatches.
The dBase format stores attributes for each shape, and its size cannot exceed 2GB.
The shapefile index format does what its name suggests, which is to organize the records of a shapefile for reference.
The projection format is essential because it contains coordinate system and projection information. As a plain text file, it describes your data using markup language, which allows it to sync with many applications.
How to import
The CartoDB interface requires the compression of shapefiles into a .zip file, all prefixed with the same name. For example, a
ne_10m_populated_places.zip file would contain
There are different methods for zipping your shapefiles- some more complicated than others.
To streamline the process, you may consider downloading a plug-in (such as 7-Zip for Windows) that is compatible with your operating system. Otherwise, Mac allows you to Ctrl-click shapefiles inside Finder and select “Compress” [filename]. The
.zip archive is created in the same location as the original file and is named
[originalfilename].zip. You can also choose File → Compress. Your file is now ready to take shape on CartoDB via drag and drop to the window pictured below:
Regardless of your preferred zip method, you will need to be mindful of selecting the complete components of your shapefile from whichever folder they are stored.