[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] spatial extents of a PostGIS db
From: Kevin Neufeld <kneufeld () refractions ! net>
Date: 2010-03-24 16:36:35
Message-ID: 4BAA3F93.9050601 () refractions ! net
[Download RAW message or body]
On 3/24/2010 1:29 AM, Mike Toews wrote:
> Hi Paul,
>
> To get the bounds for one layer/table, you need an aggregate
> (ST_Collect) and envelope on the aggregate. For one layer/table, it
> would look something like:
>
> SELECT ST_AsText(ST_Envelope(ST_Collect(the_geom))) AS envelope FROM mylayer;
>
Sorry, Mike, but I don't think you want to do this.
As an example, I have a linear table of 18 million records spanning about 12GB of \
data. Your solution will try to create a single geometry from the entire collection \
(a single 12GB geometry object) and then take the envelope of it.
Rather, as Debasish Sahu suggested, use ST_Extent \
(http://postgis.refractions.net/docs/ST_Extent.html).
Cheers,
Kevin
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic