High resolution administrative country polygons in Studio

Guest

No items found.

Guest

October 8, 2020

High resolution administrative country polygons in Studio

Guest

No items found.

Guest

October 8, 2020

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
Country level tourist entry restrictions dashboard

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.

UN M49 Subregions created with Mapbox Country Boundaries

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!

Heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 4

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 5

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

response = requests.get(

  "https://api.mapbox.com/v4/mapbox.temperature-raster-tileset/tilequery/40,-105.json",

    params={

        "layers": "temperature,wind_speed",

        "bands": "1708304400,1708311600",

    },

Optional caption
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque euismod maximus porta. Pellentesque vitae augue elit. Nam semper eros leo, nec hendrerit nunc aliquet quis. Morbi ac sapien tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur porta imperdiet lorem, ut aliquet orci pellentesque quis. Donec magna augue, molestie aliquam enim eu, auctor feugiat metus."

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

No items found.
No items found.

Related articles