At sign (@)

更新时间:
复制 MD 格式

Returns true if the 3D bounding box of object A is fully contained in the 3D bounding box of object B.

Syntax

boolean @(sfmesh A, sfmesh B);
boolean @(meshgeom A, meshgeom B);
boolean @(sfmesh A, box3d B);
boolean @(box3d A, sfmesh B);

Parameters

ParameterDescription
AThe first operand. Accepts an sfmesh, meshgeom, or box3d object.
BThe second operand. Accepts an sfmesh, meshgeom, or box3d object.

How it works

The @ operator compares the 3D bounding boxes of two spatial objects:

  • Returns true if the 3D bounding box of A is fully contained in the 3D bounding box of B.

  • Returns false if the 3D bounding box of A is not fully contained in the 3D bounding box of B.

Examples

Example 1: sfmesh contained in 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;

Output:

 count
-------
     2

Example 2: meshgeom contained in meshgeom

-- @(meshgeom, meshgeom)
SELECT count(*) FROM meshgeom_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::meshgeom @ the_meshgeom;

Output:

 count
-------
     2

Example 3: sfmesh contained in 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);

Output:

 count
-------
     0

Example 4: box3d contained in 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;

Output:

 count
-------
     2