Tilesets

CARTO BigQuery Tiler is a module of the Spatial Extension for BigQuery that allows to process and visualize very large spatial datasets stored in BigQuery.

If you have small datasets in BigQuery (few megabytes), there are solutions such as BigQuery Geo Viz to visualize them; but if you have millions or even billions of rows, you will need a system to load them progressively on a map. CARTO BigQuery Tiler allows you to do that without having to move your data out of BigQuery.

How it works

The Tiler will process your data and create a complete tileset out of it. All the map tiles for the specified zoom range will be stored in a BigQuery table in MVT format. Each individual tile is a row in this table, with the tile coordinates and the encoded MVT stored in different columns:

Row z x y carto_partition data
1 16 45340 24576 3605 H4sIAAAAAAAA/5Py52JPdt3eyCLEwM (…)
2 16 45292 24576 3605 H4sIAAAAAAAA/5Py52JjLM0pEZLgWL (…)

Visualizing and publishing your tilesets is straight-forward with Map Viewer, a tool that we have integrated into your Dashboard and that will be available from Your Tilesets after activating the Spatial Extension from your CARTO account.

The integration of tilesets with custom web map applications is also possible with CARTO Maps API, which will connect to BigQuery using your connection’s Service Account credentials to fetch and serve the tiles in a standard format, so they can be used with any web-mapping library or desktop GIS application.

Learn how to create, visualize and share your first tileset by following the Tilesets guides.

Tileset types

CARTO BigQuery Tiler enables the creation of two types of tilesets through stored procedures: simple and aggregation tilesets. We recommend their use depending on the nature of the input data:

  1. tiler.CREATE_SIMPLE_TILESET

    • Use this procedure if you have a dataset with any geography type (point, line, or polygon) and you want to see it at an appropriate zoom level.
    • The geographies will be represented exactly as stored in BigQuery, which means that if they are too small to be visible at a certain zoom level they won’t be included in the tiles at that zoom level.
    • The values associated with each feature are the same as the ones available in the source dataset.
  2. tiler.CREATE_POINT_AGGREGATION_TILESET

    • Use this procedure if you have a point dataset (or anything that can be converted to points, such as polygon centroids) and you want to see it aggregated.
    • The points will be aggregated into cells. Each feature or cell represents all the points that fall under it, so the associated properties available for visualization are generated by aggregating the values in the source dataset.
    • Values of individual points are available using single_point_properties which will only be included when a cell includes only one point. Remember that you could also get similar values with the aggregated properties using functions like ANY_VALUE or FIRST_VALUE.

Take a look at the examples and the complete reference if you need help with the SQL query specifics.

Benefits

CARTO BigQuery Tilers is:

  • Convenient – It can be run directly as SQL commands in BigQuery. The data never leaves BigQuery so you won’t have to worry about security and additional ETLs.
  • Fast – CARTO BigQuery Tiler benefits from the massive scalability capabilities of BigQuery and can process hundreds of millions of rows in a few minutes.
  • Scalable – This solution works well for 1M points or 100B points.
  • Cost-effective – Since BigQuery separates storage from computing, the actual cost of hosting these tilesets is very low. Additionally, since the tiling process runs on-demand, you’ll only pay for that processing and you won’t need to have a cluster available 24/7. Finally, we have optimized how we serve the tiles, thanks to our partitioning algorithms.