Admin 0 polygons with updated disputed boundaries and 4 different worldviews, made with MTS
The collection of high resolution administrative level-0 country polygons in Mapbox Boundaries is now available to all designers and developers using the new version of Studio, for free. The individual country polygons include updates to major disputed areas and support of four different worldviews, making it easy to create accurate country level choropleths or style individual countries.
Covid Controls is using the new boundaries in Studio to visualize how countries are responding in real time to the pandemic. From lock down status, to tourist restrictions, to case rates, the team at the travel planning site Escape designed these maps so travelers have access to the latest data — which is dynamically joined to the boundary polygons letting the data layers continuously update as official restrictions or essential services change in each country.
“It is very easy to join data against each shape and that significantly reduces our engineering and data maintenance time. The quality of polygons in Mapbox Boundaries is critical to allow us to create a differentiated user experience.” Mohit Shah, Founder at Escape
Data in Studio
The updated country boundary polygons are available in Studio, and we just updated our code samples for joining data to polygons and styling a single country. The full details and specification are on the vector tile reference documentation page, including a list of all properties available including ISO alpha-2, ISO alpha-3, Wikidata ID, color group, and UN M49 region & subregion.
Dogfooding MTS, and example recipes
We continuously update our boundaries using Mapbox Tiling Service (MTS), which is now open to all developers. MTS is the same pipeline we use internally to curate the 4 million global polygons in Mapbox Boundaries. In our most recent update we added a new collection of US legislative boundaries at four different levels to improve data analysis and visualizations, including Congressional districts and state legislatures. Here is a sample of the MTS recipe (a configuration document) we used to create this tileset:
Simplification using recipes: Simplifying data via MTS means removing complexity in the vertices of feature geometries. Simplification is helpful because each additional vertex must be translated to vector tile coordinates and the fewer vertices to translate, the faster processing and rendering become. The lower the simplification value, the more precise your features. In the above recipe, we’ve optimized the simplification at low zoom levels for certain countries, ensuring small island nations like Maldives are not oversimplified while shapes for Greenland and Antarctica have extra simplification of their complex coastlines to reduce the final tile size.
Setting feature IDs: Recipes in MTS let our team set unique feature IDs for each feature, in the case of Mapbox Boundaries that is a unique ID for each country polygon. We use each feature ID to power client-side data visualization and interactions, for example with GL JS’s setFeatureState.
Controlling Feature Order: The order of features in the tiles impacts the visibility of overlapping features in the map. By specifying a data attribute that can be used for feature ordering in MTS, we can ensure that overlapping disputed polygons are always visible above the country polygons in the map.
Allowed Output: vector tile attributes, encoded as strings, usually require a considerable amount of bytes. When source data has a lot of feature attributes it’s important to only include the attributes in the tileset needed for styling — this is where allowed_output is used in recipes for MTS!