When covering the US elections, not all map projections are created equal. Representation of all states matters. Albers USA is typically the go-to projection for US Elections because it shows a non-distorted Alaska and Hawaii in close proximity to the rest of the states. However, Mapbox basemaps are rendered in a web mercator projection by default.
For election visualizations and analysis, we created a map style that includes polygons and points for states and counties in an Albers USA projection. We've also included Puerto Rico for visualizations that go beyond election results, like campaign finance maps.
The Albers USA map style features two tilesets, one for polygons and one for points -- “albersusa” and “albersusa-point” respectively. Each tileset has geometries for both states and counties.
Both tilesets contain two sets of geometry, distinguishable by the `type` property. Polygons and points that are of type "state" feature the following properties:
Polygons and points that are of type `county` contain the following properties:
The data comes from the US Census 2018 cartographic boundary shapefiles. Territories like Guam and Puerto Rico were removed. To reproject and modify the data, we used the Mapshaper and Dirty Reprojectors npm packages.
To use the style and the tileset, you will need a Mapbox account. You can:
You can also join data to geometries using feature-state and the `promote-id` method.
The style is a representation of Albers USA in a web mercator projection. This means that to add any additional geometries, like points or polygons, you will need to reproject that data using Dirty Reprojectors in order to display “correctly” over the United States.
Read the tutorial: Guide to Albers USA projection in Studio.