Customizable Tile Size Limits

Erica Fischer

Jul 28, 2021

Customizable Tile Size Limits

Guest

Erica Fischer

Guest

Jul 28, 2021

The Customizable Tile Size Limit is available on Mapbox Tiling Service (MTS). With increased default limits and configurable tile size limits, MTS enables customers to tile 2.5 to 5 times more features than before while improving the experience of visualizing large amounts of data and iterating on tilesets. 

Increased default tile size limit from 500KB to 1250KB

To ensure the map viewing experience is fast and seamless for end users, MTS generates tilesets where each layer has a specific tile size limit. These limits also protect MTS from generating excessively large tiles. When a tilest exceeds tile size limits, MTS provides a warning message in the Tileset Explore UI informing customers that features were dropped from the layers that exceeded the tile size limits with affected zoom levels. 

With the new default tile size limit of 1250KB, customers can have 2.5 times more data to the tilesets than before. We chose the new limits based on processing/ rendering performance and tile size analysis to allow a larger limit while preserving the performance of the tilesets. 

Customizable layer sizes

MTS now also allows customizable layer size limits up to 2500KB with a simple recipe configuration "layer_size": your limit. See how to use the feature in action in the New York Times Precinct Map and EV Charging Stations examples. 

If there is a need to increase the layer size beyond 2500KB, please contact support.

Understanding where features are dropped 

When features drop in a tileset due to tile size limits, it can be difficult to know what area of the source data is being impacted. MTS now offers a  capped_tiles field, listing the tiles that most greatly exceeded the limit as well as the layer_size associated with that tile. This tool is a great resource to understand the zxy location of a particular tile. 


{
  "id": "unique_hash",
  "stage": "success",
  "created": 1560981902377,
  "created_nice": "Wed Jun 19 2019 22:05:02 GMT+0000 (UTC)",
  "tilesetId": "user.id",
  "errors": [],
  "warnings": [],
  "tileset_precisions": { "1m": 658731.7540137176 },
  "layer_stats": {
    "sample_pois": {...,
      "zooms": {
        "0": {...,
          "capped_list": [ { "layer_size": 1337, "tile": "0/0/0" } ],
	    ...,
        }
      }  
    }
  },
  "recipe": {...}
}

Example: New York Times Precinct Map

The New York Times aggregates Presidential election results at the precinct level. This dense polygon data requires a larger layer size limit than the default. The new configurable tile size limit enables custom increases to the tile size, ranging from 1,500 - 2,500KB. 

Open data supplied by TheUpshot. This tileset, mapbox-public.election-with-results, is publicly available.


The recipe below sets the layer_size recipe option to increase the tile size threshold. 


{
  "version": 1,
  "layers": {
    "precincts": {
      "minzoom": 0,
      "maxzoom": 12,
      "source": "mapbox://tileset-source/username/source",
      "features": {"simplification": {"distance": 0, "outward_only": true}},
      "tiles": {
        "id": null,
        "extent": ["case", ["<=", ["zoom"], 7], 2048, 4096],
        "layer_size": 2500
      }
    }
  }
}

Example: EV Charging Stations 

The Department of Energy provides data about the location of EV charging stations throughout the US. Applications in a variety of industries can use this dataset to assist the users to find charging stops along new routes or within their community. This dense POI data requires a larger tile size limit than the default. When attempting to tile the data with the default limits, we are able to see in the capped_list that features are dropping and the largest tile size needed is ~1,900KB. By setting the 2,000KB limit in the recipe, the full dataset is now available at the country-level perspective.



The recipe below sets the `layer_size` recipe option to increase the default tile size threshold. 


{
  "version": 1,
  "layers": {
    "charge": {
      "minzoom": 2,
      "maxzoom": 12,
      "source": "mapbox://tileset-source/username/us_evcharging",
      "features": {
        "id": ["get", "id"],
        "attributes": {"allowed_output": ["id"]}
      },
      "tiles": {"layer_size": 2000}
    }
  }
}

There are many recipe configurations available to generate powerful map visualizations, stories, and analyses. Starting tiling your data with MTS today! 

No items found.
No items found.

Maps feature data from Mapbox © Mapbox, OpenStreetMap © OpenStreetMap and their data partners, including Maxar (if applicable, © Maxar).

Related articles