Shapefiles are the most popular vector-based file format. They contain polygons and lines that represent geographic boundaries. The shapefile format was developed by the company Esri as an open standard to work with geographic information systems (GIS). This vector information can also describe other geographic entities (rivers, lakes, and railroads). In addition, the file format has the ability to store data attributes that are useful when working with visualizations (for example, the name of the geographic object, the type, and some relationships). Most importantly for us, there is a large repository of free shapefiles located at http://diva-gis.org. This repository contains a tremendous wealth of data at different levels of specificity and granularity.
Unfortunately for us, shapefiles are in binary format and can be very large. This makes them very difficult, if not impossible, to use in standard web development. Thankfully, there are some tools to help us leverage the large repository of shapefiles and convert them to GeoJSON and TopoJSON. GeoJSON and TopoJSON are JavaScript-friendly, much smaller, and easier to use in our web development context. In the previous chapters, all of the geographic data was provided in TopoJSON.