Created
February 23, 2012 16:27
-
-
Save andrewxhill/1893544 to your computer and use it in GitHub Desktop.
Creates a bounding circle from the_geom_webmercator on cartodb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH inp as ( SELECT ST_Centroid(ST_Collect(ST_envelope(the_geom_webmercator))) as centroid, | |
ST_ConvexHull(ST_Collect(ST_Envelope(the_geom_webmercator))) as hull | |
FROM table_name GROUP BY some_column) | |
SELECT ST_Buffer(centroid, | |
ST_Length( ST_LongestLine(centroid, hull))) as the_geom_webmercator | |
FROM inp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment