Tests whether the bounding boxes of two 3D spatial objects intersect. Supported operand types are sfmesh, meshgeom, and box3d.
Syntax
boolean &&(sfmesh A, sfmesh B);
boolean &&(meshgeom A, meshgeom B);
boolean &&(sfmesh A, box3d B);
boolean &&(box3d A, sfmesh B);Parameters
| Parameter | Description |
|---|---|
| A | An sfmesh, meshgeom, or box3d object. |
| B | An sfmesh, meshgeom, or box3d object. |
Description
&& compares the bounding boxes of two 3D spatial objects and returns true if they intersect, or false if they do not.
Examples
Example 1: &&(sfmesh, sfmesh)
--&&(sfmesh, sfmesh)
SELECT COUNT(*) FROM mesh_gist_test WHERE '{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(307248.723802283 296449.440306073 6500.00004882812,307248.723802283 296449.440306073 100,307258.460240141 296449.440306073 6500.00004882812,307258.460240141 296449.440306073 100,307258.460240141 296474.440306263 6500.00004882812,307258.460240141 296474.440306263 100,307248.723802283 296474.440306263 6500.00004882812,307248.723802283 296474.440306263 100),INDEX((0,1,2),(3,2,1),(4,5,6),(7,6,5),(3,1,7),(7,5,3),(2,3,4),(5,4,3),(0,2,4),(4,6,0),(1,0,7),(6,7,0)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}'::mesh && the_mesh;Result:
6Example 2: &&(sfmesh, box3d)
--&&(sfmesh, box3d)
SELECT COUNT(*) FROM mesh_gist_test WHERE the_mesh && st_3dmakebox('POINT(206126.22379756 290161.940316926 5249.99990997314)'::geometry,'POINT(226126.22379756 300161.940316926 7249.99990997314)'::geometry);Result:
19Example 3: &&(box3d, sfmesh)
--&&(box3d, sfmesh)
SELECT COUNT(*) FROM mesh_gist_test WHERE st_3dmakebox('POINT(206126.22379756 290161.940316926 5249.99990997314)'::geometry,'POINT(226126.22379756 300161.940316926 7249.99990997314)'::geometry) && the_mesh;Result:
19该文章对您有帮助吗?