Renvoie true si une grille géographique (geomgrid) contient entièrement une géométrie 3D, ou si une grille en contient entièrement une autre.
Syntaxe
bool ST_3DContains(geometry geom3d, geomgrid gridcode);
bool ST_3DContains(geomgrid gridcode, geometry geom3d);
bool ST_3DContains(meshgeom geom3d, geomgrid gridcode);
bool ST_3DContains(geomgrid gridcode, meshgeom geom3d);
bool ST_3DContains(sfmesh geom3d, geomgrid gridcode);
bool ST_3DContains(geomgrid gridcode, sfmesh geom3d);
bool ST_3DContains(vomesh geom3d, geomgrid gridcode);
bool ST_3DContains(geomgrid gridcode, vomesh geom3d);
bool ST_3DContains(geomgrid gridcode1, geomgrid gridcode2);
Paramètres
| Paramètre | Description |
|---|---|
gridcode / gridcode1 / gridcode2 |
Objet de grille géographique. |
geom3d |
Géométrie 3D. |
Description
La fonction ST_3DContains renvoie la relation spatiale entre une grille et une géométrie.
La géométrie 3D doit utiliser le système de référence spatiale CGC2000 (China Geodetic Coordinate System 2000) avec un identifiant de système de référence spatiale (SRID) égal à 4490.
Exemples
Les exemples suivants couvrent toutes les combinaisons de types d'arguments prises en charge.
Une grille geomgrid contient un point géométrique
La grille GZ00262064446046072072 contient entièrement le point 3D spécifié ; la fonction renvoie donc t.
SELECT ST_3DContains(
ST_GridFromText('GZ00262064446046072072'),
'srid=4490;POINT(116.31522216796875 39.910277777777778 1001.8)'::geometry
);
st_3dcontains
---------------
t
Une grille geomgrid contient un objet meshgeom
Le solide meshgeom s'étend au-delà des limites de la grille GZ0026 ; la fonction renvoie donc f.
SELECT ST_3DContains(
ST_GridFromText('GZ0026'),
st_meshgeomfromtext('srid=4490;SOLID=TRUE;MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(115.966 38.9757000000001 3000,
116 38.9757000000001 3000,116 38.9999999999999 3000,115.966 38.9999999999999 3000,116 38.9999999999999 0,
116 38.9757000000001 0,115.966 38.9757000000001 0,115.966 38.9999999999999 0),
INDEX((0,1,2),(2,3,0),(4,5,6),(6,7,4),(3,7,6),(6,0,3),(0,6,5),(5,1,0),(1,5,4),(4,2,1),(2,4,7),(7,3,2)))))'))
);
st_3dcontains
---------------
f
Une grille geomgrid contient un objet sfmesh
L'objet sfmesh (au format JSON) n'est pas entièrement contenu dans la grille GZ00262064 ; la fonction renvoie donc f.
SELECT ST_3DContains(
ST_GridFromText('GZ00262064'),
st_meshfromtext(
'{"version" : 1, "srid" : 4490, "root" : 0,
"meshgeoms" : ["MESHGEOM(PATCH(POLYGON Z ((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0))))"],
"primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0,"matrix" : [0.012,0,0,116,0,0.009,0,39,0,0,1000,0,0,0,0,1]}]}'
)
);
st_3dcontains
---------------
f
Une grille geomgrid contient un objet vomesh
L'objet vomesh n'est pas entièrement contenu dans la grille GZ00262064 ; la fonction renvoie donc f.
SELECT ST_3DContains(
ST_VOMeshFromText(
'SRID=4490;LOD=2;VOMESH(VERTEX(COORDS(116.012 39 0,116 39.009 0,115.988 39 0,116 38.991 0,116 39 1000)),
FACE(INDEX((0,1,2,3),(1,0,4),(2,1,4),(3,2,4),(0,3,4))),CELL(INDEX((0,1,2,3,4)),DIRECTION((0,1,1,1,0))))'
),
ST_gridfromtext('GZ00262064')
);
st_3dcontains
---------------
f
Une grille geomgrid en contient une autre
La grille GZ00262064 est une grille de niveau plus grossier qui contient entièrement la grille de niveau plus fin GZ002620643 ; la fonction renvoie donc t.
SELECT ST_3DContains(
ST_GridFromText('GZ00262064'),
ST_GridFromText('GZ002620643')
);
st_3dcontains
---------------
t
Étapes suivantes
ST_GridFromText— construit une grille geomgrid à partir d'une chaîne de code de grilleST_MeshGeomFromText— construit un objet meshgeom à partir d'un texte WKTST_VOMeshFromText— construit un objet vomesh à partir d'un texte WKTST_3DIntersects— vérifie si deux géométries ou grilles 3D s'intersectent