[postgis-users] getting non-latlon extent as lat/lon

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Aug 5 07:17:54 PDT 2006


On Sat, 2006-08-05 at 05:03 -0700, Steve Benzo wrote:
> Ok, that seems to get me a bunch of lat/lon coordinates, but how do I
> translate those into an extent then? Thanks.
>  
> SB


Hi Steve,

How about something like this:

SELECT AsText(transform(extent(the_geom), 4326) FROM geomtable;

Note that since extent() is an aggregate it will scan the entire table
to produce the overall extent which can be slow on larger tables; you
may like to consider using the estimated_extent() function if you need
to do this interactively as part of an application.


Kind regards,

Mark.





More information about the postgis-users mailing list