Created
November 8, 2022 14:23
-
-
Save wriglz/676dbc40456c25ce8988c0f5b8c03bcf to your computer and use it in GitHub Desktop.
Script utlising CARTO H3 support to visualise OSM Edits for the United Kingdom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
bbox GEOGRAPHY; | |
SET | |
bbox = ( | |
SELECT | |
geom | |
FROM | |
`global_boundaries_dataset` | |
WHERE | |
NAME_EN = 'United Kingdom'); | |
WITH | |
h3s AS ( | |
SELECT | |
id, | |
`carto-un`.carto.H3_FROMGEOGPOINT(geometry, | |
8) AS h3 | |
FROM | |
`bigquery-public-data.geo_openstreetmap.history_nodes` | |
WHERE | |
ST_INTERSECTS(geometry,bbox)) | |
SELECT | |
COUNT(id) AS edit_count, | |
h3 | |
FROM | |
h3s | |
GROUP BY | |
2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment