Re: a spatial table's bounding box

From: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
To: Asli Akarsakarya <asliakar(at)yahoo(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: a spatial table's bounding box
Date: 2011-09-23 19:18:09
Message-ID: CAP_rwwmM_dt7eCNGRy98sYj2FNgT1+=59urVrM2ozWT32owj+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2011/9/22 Asli Akarsakarya <asliakar(at)yahoo(dot)com>

>
> I want to get the extensions of spatial table. Say that there is a spatial table named 'roads', and a some road geometry inside. I want to fetch the bounding box (envelope or extension) for that table, that means for all the roads that it has.
>
> According the OGC specification, this should be defined in the "geometry_columns" table. As four columns, "minX", "minY", "maxX" and "maxY". But I couldn't find it anywhere on my postgis. Yet.
>
> From which table/view? With what SQL?
>
>
>
I would try

SELECT st_envelope( st_collect(geom) ) FROM roads;

HTH, Filip

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas 2011-09-24 00:06:16 Howto build a funtion that selects an id or inserts a value
Previous Message Filip Rembiałkowski 2011-09-23 16:14:14 Re: help with xpath namespace