Returns the 2D bounding box of a pcpatch object as a Ganos Geometry polygon. Use this function to run spatial intersection tests with Ganos Geometry functions or to build a Generalized Search Tree (GiST) index on a point cloud table for efficient spatial queries.
Syntax
geometry ST_EnvelopeGeometry(pcpatch pc);Parameters
| Parameter | Description |
|---|---|
pc | The pcpatch object. |
Examples
The following example retrieves the bounding box of a patch as a WKT polygon:
SELECT ST_AsText(ST_EnvelopeGeometry(pa)) FROM patches LIMIT 1;Expected output:
POLYGON((-126.99 45.01,-126.99 45.09,-126.91 45.09,-126.91 45.01,-126.99 45.01))The following example creates a GiST index on the bounding boxes of all patches to speed up spatial queries:
CREATE INDEX ON patches USING GIST(ST_EnvelopeGeometry(patch));