[postgis-devel] I want boxes

Chris Hodgson chodgson at refractions.net
Tue Nov 8 10:20:32 PST 2011


I'm guessing that if A and B are large geometries and/or already have 
BBox caches, this:

ST_Envelope(ST_Collect(ST_Envelope(A), ST_Envelope(B)));

would be faster... should save copying all the coordinates.

If I'm right, perhaps a non-agreggate st_extent() function is in order, because that doesn't seem like such a weird thing to do yet requires a lot of function calls to do efficiently.

Chris

Sandro Santilli wrote:
> I need to compute the geographical extent of a set of records.
> But I do not have them all in a raw, so can't use the ST_Extent
> aggregate. Rather I'll have to simulate the aggregate myself,
> in pl/pgsql.
>
> I don't want GEOS to be involved (why would it?).
> So, what I'd be normally doing is.... have a BOX returned
> for each row and merge consecutive BOXES into a state BOX.
>
> As of PostGIS-2.0.0, what's the recommended way for doing this ?
>
> Note that I'll want the final BOX to hold dimension informations.
>
> This seems to be the closest to what I need:
>
>   ST_Envelope(ST_Collect(A, B));
>
> Is that the best practice ?
>
> --strk; 
>
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>   




More information about the postgis-devel mailing list