Marc, Would the following work: box2d(transform( extent(wkb_geometry), 4326) )
I think that you will achieve an efficiency from the following points: 1. you should not need to collect, if all you want is the bounding box, since extent() should give you that 2. Even if you DO have to use collect, you will save lots of computation time by doing the transform on the final aggregate (1 transform), rather than for every record (100,000 transforms). Robert W. Burgholzer Surface Water Modeler Office of Water Supply and Planning Virginia Department of Environmental Quality [EMAIL PROTECTED] 804-698-4405 Open Source Modeling Tools: http://sourceforge.net/projects/npsource/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Jacquin Sent: Monday, June 30, 2008 9:23 AM To: 'PostGIS Users Discussion' Subject: [postgis-users] Collecting points for the overall bounding box Hi all, The request is quite simple, something like: SELECT box2d(collect(transform(wkb_geometry,4326))) FROM mytable Mytable contains about 100000 records of a point type geometry. A GIST index is available for the table but it takes several minutes on a respectable recent dual-core with 4 Gb of RAM. Any idea would be helpful. Thx. Marc
_______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users