全部產品
Search
文件中心

PolarDB:ST_MetaData

更新時間:Jul 06, 2024

獲得raster對象的中繼資料,返回JSON格式。

文法

text ST_MetaData(raster raster_obj);
text ST_MetaData(raster raster_obj,
                text key);
text ST_MetaData(raster raster_obj,
                integer band,
                text key);

參數

參數名稱描述
raster_objraster對象。
band波段序號,從0開始。
key需要查詢的中繼資料項名稱,如果傳入的是all,則返回一個包含所有中繼資料項的JSON。

樣本

select ST_MetaData(raster_obj) from raster_table;

-- meta data with a name
SELECT ST_MetaData(raster_obj, 'swh#scale_factor')
FROM raster_table;

      st_metadata      
-----------------------
 0.0001488117874873806
 
-- all meta data
SELECT ST_MetaData(raster_obj, 'all')
FROM raster_table;

      st_metadata      
-----------------------
{"AREA_OR_POINT":"Area"}

-- meta data with a name of a band
SELECT ST_MetaData(raster_obj, 0, 'NETCDF_DIM_time')
FROM raster_table;

 st_metadata 
-------------
 1043112     
 
 -- all meta data of a band
SELECT ST_MetaData(raster_obj, 'all')
FROM raster_table;

                                                              st_metadata                                                               
----------------------------------------------------------------------------------------------------------------------------------------
{"add_offset":"4.907141431495487","long_name":"Significant height of combined wind waves and swell","missing_value":"-32767","NETCDF_DI.
M_time":"1043112","NETCDF_VARNAME":"swh","scale_factor":"0.0001488117874873806","units":"m","_FillValue":"-32767"}