Skip to content

Instantly share code, notes, and snippets.

@jatorre
Created October 8, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jatorre/ded44ab09480ae1ec5ac5fb05ee66700 to your computer and use it in GitHub Desktop.
Save jatorre/ded44ab09480ae1ec5ac5fb05ee66700 to your computer and use it in GitHub Desktop.
CALL cartobq.tiler.ST_PointAggregationAsMVT(
--SQL to use as the source (use geom as name for geography)
'''(SELECT ST_Centroid(geometry) as geom
FROM `bigquery-public-data.geo_openstreetmap.planet_layers`
where layer_name ='building')''',
--Name and location where the Tileset will be stored. Replace:
'`cartobq.maps.osm_buildings_weekly`',
--Options on how to generate the Tileset
'''{
"zoom_max": 14,
"type": "quadkey",
"resolution": 8,
"placement": "cell-centroid",
"columns":{
"aggregated_total": {
"function": "count",
"column": "*",
"type": "Number"
}
}
}''');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment