返回給定Geometry對(duì)象的維度數(shù)。

語(yǔ)法

integer  ST_CoordDim(geometry  geomA);

參數(shù)

參數(shù)名稱 描述
geomA 目標(biāo)Geometry對(duì)象。

描述

  • 這是ST_NDims
  • 該函數(shù)支持Circular Strings、Curves、Polyhedral surfaces、Triangles、Triangulated Irregular Network Surfaces(TIN)和3D對(duì)象。

示例

  • 2維對(duì)象:
    SELECT ST_CoordDim('POINT(1 0)');
     st_coorddim
    -------------
               2
    (1 row)
                        
  • 3維對(duì)象(3DM和3DZ):
    SELECT ST_CoordDim('POINT(1 0 1)');
     st_coorddim
    -------------
               3
    (1 row)
    
    SELECT ST_CoordDim('POINTM(1 0 1)');
     st_coorddim
    -------------
               3
    (1 row)
                        
  • 4維對(duì)象:
    SELECT ST_CoordDim('POINT(1 0 1 1)');
     st_coorddim
    -------------
               4
    (1 row)