PostGIS: Bounding box of a MultiPolygon column


/ Published in: SQL
Save to your folder(s)

**Important: this snipplet has moved to Github.**

- [Bounding box of a MULTIPOLYGON column in PostGIS](https://gist.github.com/1973043)


Copy this code and paste it in your HTML
  1. -- If `polygons` is a column containing multipolygons, this returns one row per polygon.
  2.  
  3. SELECT id AS id, ST_Box2D((ST_Dump(polygons)).geom) AS bbox FROM mytable WHERE polygons IS NOT NULL;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.