Created
March 4, 2012 13:43
-
-
Save cecilemuller/1973043 to your computer and use it in GitHub Desktop.
Bounding box of a MULTIPOLYGON column in PostGIS
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
-- If `polygons` is a column that contains MULTIPOLYGON values, | |
-- this returns one row per polygon. | |
SELECT | |
id AS id, | |
ST_Box2D((ST_Dump(polygons)).geom) AS bbox | |
FROM | |
mytable | |
WHERE | |
polygons IS NOT NULL | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment