Skip to content

Instantly share code, notes, and snippets.

@cosh
Created June 14, 2021 20:53
Show Gist options
  • Save cosh/acbc84f82441f3d41a2b73e8b26d9ae9 to your computer and use it in GitHub Desktop.
Save cosh/acbc84f82441f3d41a2b73e8b26d9ae9 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
datatable(lng:real, lat:real)
[
-73.956683, 40.807907,
-73.916869, 40.818314,
-73.989148, 40.743273,
]
| project s2_hash = geo_point_to_s2cell(lng, lat, 10)
| project s2_hash_polygon = geo_s2cell_to_polygon(s2_hash)
| summarize s2_hash_polygon_lst = make_list(s2_hash_polygon)
| project pack(
"type", "Feature",
"geometry", pack("type", "GeometryCollection", "geometries", s2_hash_polygon_lst),
"properties", pack("name", "S2 Cell polygons collection"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment