Skip to content

Instantly share code, notes, and snippets.

@wriglz
Created July 14, 2022 08:11
Show Gist options
  • Select an option

  • Save wriglz/65e04bdcfd8c9cef3ea74da8a4bab449 to your computer and use it in GitHub Desktop.

Select an option

Save wriglz/65e04bdcfd8c9cef3ea74da8a4bab449 to your computer and use it in GitHub Desktop.
SQL to parse geometry object from GeoJSON feature collection for use in BigQuery
UPDATE
`project.dataset.table`
SET
geom = ST_GEOGFROMGEOJSON(
JSON_QUERY(geo_json,'$.geometry'), make_valid => TRUE)
WHERE
geom IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment