Skip to content

Instantly share code, notes, and snippets.

@allenday
Last active December 27, 2019 05:28
Show Gist options
  • Save allenday/ed1a153d8730d178e1611892be32144d to your computer and use it in GitHub Desktop.
Save allenday/ed1a153d8730d178e1611892be32144d to your computer and use it in GitHub Desktop.
Find all obsolete fire hydrants on the planet
SELECT *
FROM
`bigquery-public-data.geo_openstreetmap.history_nodes` AS node JOIN UNNEST(all_tags) AS tags
WHERE
(tags.key = 'emergency' AND tags.value = 'fire_hydrant')
AND id NOT IN (
SELECT id
FROM
`bigquery-public-data.geo_openstreetmap.planet_nodes` AS node JOIN UNNEST(all_tags) AS tags
WHERE
(tags.key = 'emergency' AND tags.value = 'fire_hydrant')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment