將一個raster對象導出為OSS文件。

語法

boolean ST_ExportTo(raster source,
  cstring format,
  cstring url,
  integer level = 0);

參數

參數名稱描述
source需要導出的raster對象。
format導出的數據,常見如 GTiff,BMP 等。
url外部文件路徑。詳情請參見ST_CreateRast 中構建路徑的描述。
level金字塔級別。

描述

導出成功返回true,失敗則返回false。

format指定導出格式的名稱,常見格式如下。

名稱全稱
BMPMicrosoft Windows Device Independent Bitmap(.bmp)
EHdrESRI .hdr Labelled
ENVIENVI .hdr Labelled Raster
GTiffTIFF/BigTIFF/GeoTIFF(.tif)
HFAErdas Imagine .img
RSTIdrisi Raster Format
INGRIntergraph Raster Format

示例

DO $$
declare
    rast raster;
begin
    select raster_obj into rast from raster_table where id = 1;
    Select ST_ExportTo(rast, 'GTiff', 'OSS://ABCDEFG:1234567890@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/4.tif');
end;    
$$ LANGUAGE 'plpgsql';