[postgis-users] Collecting points for the overall bounding box

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Mon Jun 30 07:08:27 PDT 2008


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

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] 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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080630/a6afacd3/attachment.html>


More information about the postgis-users mailing list