ST_As3DGrid
更新時(shí)間:
將三維幾何對(duì)象轉(zhuǎn)換為地理網(wǎng)格表達(dá)。
語法
geomgrid[] ST_As3DGrid(geometry geom3d, integer precision, bool degenerated default false);
geomgrid[] ST_As3DGrid(meshgeom geom3d, integer precision, bool degenerated default false);
geomgrid[] ST_As3DGrid(sfmesh geom3d, integer precision, bool degenerated default false);
geomgrid[] ST_As3DGrid(vomesh geom3d, integer precision, bool degenerated default false);
參數(shù)
參數(shù)名稱 | 描述 |
geom3d | 需要計(jì)算網(wǎng)格對(duì)象的幾何對(duì)象。 |
precision | 地理網(wǎng)格精度級(jí)別,取值范圍:1~32。 |
degenerated | 是否采用退化網(wǎng)格。 |
描述
幾何對(duì)象的空間參考必須是CGC2000(SRID=4490),請(qǐng)確保能正確轉(zhuǎn)換到CGC2000坐標(biāo)系統(tǒng)。
返回幾何對(duì)象相交的網(wǎng)格對(duì)象數(shù)組,示意圖如下所示:
示例
SELECT ST_AsText(ST_As3DGrid(
'srid=4490;LINESTRING Z (116 39 2000,116.012 39.009 3000)'::geometry, 10));
st_astext
-------------------------------------------------------
{GZ0026204626,GZ0026204662,GZ0026206404,GZ0026206440}
SELECT ST_AsText(ST_As3DGrid(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)))))'),10));
st_astext
-------------------------------------------------------
{GZ0026204626,GZ0026206404,GZ4026204626,GZ4026206404}
SELECT ST_AsText(ST_As3DGrid(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]}]}'),8,true));
st_astext
-----------------------------------------------
{GZ00262046,GZ00262064,GZ40262046,GZ40262064}
SELECT ST_AsText(ST_As3DGrid(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))))'),15, true));
st_astext
---------------------------------------------------------------------------------------
------------------------------------------------------------
{GZ002620462666066,GZ002620466222022,GZ002620640444044,GZ002620644000000,GZ402620462666066,
GZ402620466222022,GZ402620640444044,GZ402620644000000}
文檔內(nèi)容是否對(duì)您有幫助?