Tests whether a scene object lies entirely within a meshgeom object.
Syntax
bool ST_Within(scene sc, meshgeom geom);Parameters
| Parameter | Type | Description |
|---|---|---|
sc | scene | The scene object to test. |
geom | meshgeom | The meshgeom object that must contain sc. |
Return value
Returns bool.
Returns
trueifsclies entirely insidegeom.Returns
falseifscis only partially insidegeom.Returns
falseifgeomis empty.
Description
ST_Within tests whether every point of a scene object lies inside a meshgeom object. It is the inverse of ST_Contains.
Examples
The following example tests whether a 3D sphere is fully contained within an extruded and translated polygon box.
SELECT ST_Within(
ST_3DSphere(0.5, 1),
ST_Translate(ST_Extrude('Polygon((-1 -1, 1 -1, 1 1, -1 1, -1 -1))', 2), 0, 0, -1));Result:
--------
tSee also
ST_Contains— tests whether ameshgeomobject contains asceneobject; the inverse ofST_Within
该文章对您有帮助吗?