Skip to content

Instantly share code, notes, and snippets.

@djouallah
Created July 17, 2020 01:13
Show Gist options
  • Save djouallah/91782fd407c9f16433d5dbe33e326be7 to your computer and use it in GitHub Desktop.
Save djouallah/91782fd407c9f16433d5dbe33e326be7 to your computer and use it in GitHub Desktop.
WITH Geographies AS
(SELECT ST_GEOGFROMTEXT('POINT(1 1)') AS g ,'newgeopmetry' as t UNION ALL
SELECT ST_GEOGFROMTEXT('POINT(1 3)') AS g ,'newgeopmetry' as t UNION ALL
SELECT ST_GEOGFROMTEXT('POINT(1 2)') AS g ,'newgeopmetry' as t )
SELECT
t, ST_CONVEXHULL(g) AS polygon FROM Geographies group by 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment