Skip to content

Instantly share code, notes, and snippets.

@chapmanjacobd
Created March 10, 2021 00:22
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 chapmanjacobd/9bce131d3375b3d209ec11e10574360b to your computer and use it in GitHub Desktop.
Save chapmanjacobd/9bce131d3375b3d209ec11e10574360b to your computer and use it in GitHub Desktop.
BigQuery GeoJSON Export Query
SELECT boundary_id, TO_JSON_STRING((SELECT AS STRUCT
'Feature' as type,
b.id as id,
st_asgeojson(geom) as geometry,
(SELECT AS STRUCT my_geo_json_property as value) as properties
))
from aggregate.stats s
join reference.boundaries b on b.id = s.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment