Hex Tile Functions

The Data SDK contains a variety of endpoints for the Hex Tile system.

Hex Tiles is Studio's analytic tiling system for geospatial data that combines the ability of tiling systems to handle massive datasets with the power of the H3 hierarchical grid system, enabling a tabular data view with full data integrity at all resolutions.

Generate Hex Tiles

Process a geospatial dataset into Hex Tiles using the Studio Data SDK. Pass a source UUID ordataset record to convert to Hex Tiles. Requires either a hex (H3) column or latitude and longitude columns.

# Generate Hex Tiles
    source_time_column = "time",
    source_lat_column = "lat",
    source_lng_column = "lon",
    finest_resolution = 9,
    time_intervals= ["HOUR"],
    output_columns= [
        "source_column": "precip_kg/m2",
        "target_column": "precip_sum",
        "agg_method": "sum"
uf-data-sdk generate-hextile 
  --source e32f527e-0917-40aa-955f-8d55105f9673 
  --source-lat-column Latitude 
  --source-lng-column Longitude 
  --output-column '{"sourceColumn":"Magnitude", "targetColumn":"Avg Magnitude", "aggMethod":"mean"}' 
  --output-column '{"sourceColumn":"Depth", "targetColumn":"Max Depth", "aggMethod":"max"}' 
  --finest-resolution 5
curl -X POST https://data-api.foursquare.com/internal/v1/datasets/hextile \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw '{
    "source": "<source_dataset_id>",
    "sourceHexColumn": "hex",
    "sourceTimeColumn": "datestr",
    "timeIntervals": ["DAY"],
    "targetResOffset": 4,
    "outputColumns": [
        "sourceColumn": "metric",
        "targetColumn": "metric_sum",
        "aggMethod": "sum"

Learn more in the SDK reference


Try it now in the interactive API explorer

Enrich Dataset with Hex Tiles

You can enrich a dataset with Hex Tiles. Enriching refers to the process of joining Hex Tiles with another datasets to enrich them with contextual information. Requires a dataset to enrich with, which can be a UUID, dataset object, or dataframe.

# Enrich dataset with Hex Tiles
curl -X POST https://data-api.foursquare.com/internal/v1/datasets/hextile \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'Accept: text/csv' \
--data-raw '{
    "type": "enrich",
    "input": [
            "type": "dataset",
            "uuid": "my-target-uuid"
    "sourceId": "my-hex-tile-uuid",
    "sourceColumn": "some_value",
    "timeColumn": "date",
    "targetType": "LATLNG",
    "latColumn": "lat",
    "lngColumn": "lng"

Learn more in the SDK reference.

Extract Hex Tiles

You may specify an area of Hex Tiles (represented by a GeoJSON geometry) for extraction. This function returns a geopandas H3 dataframe containing all fields from the Hex Tile dataset at the specified resolution.

# Extract Hex Tiles within a specified GeoJSON geometry
extracted_dataset = data_sdk.tile_extract(
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
            [0, 0],
            [0, 10],
            [10, 0],
            [0, 0]
curl -X POST https://data-api.foursquare.com/internal/v1/query HTTP/1.1
    Note: Extracting Hextiles makes use of Studio's Query API.
    Please contact us if you wish to use the Query API to extract Hex Tiles.

Learn more in the SDK reference.