Skip to content

Instantly share code, notes, and snippets.

@zacharyDez
Created November 23, 2022 18:45
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 zacharyDez/b88e034bceda5a638430b0584a44c9cb to your computer and use it in GitHub Desktop.
Save zacharyDez/b88e034bceda5a638430b0584a44c9cb to your computer and use it in GitHub Desktop.
create table chief_loop_bounds_out as
with world as (
select st_makeenvelope(-180, -90, 180, 90, 4326) geom
),
env as (
select st_transform(st_minimumboundingcircle(st_collect(t.geom)), 4326) geom from dbt.chief_three_peaks_loop t
)
select st_makepolygon(st_exteriorring(w.geom), Array[st_exteriorring(t.geom)]) geom from world w, env t;
create table chief_loop_bounds_in as
select st_transform(st_minimumboundingcircle(st_collect(t.geom)), 4326) geom from dbt.chief_three_peaks_loop t;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment