將一個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指定導出格式的名稱,常見格式如下。
名稱 | 全稱 |
---|---|
BMP | Microsoft Windows Device Independent Bitmap(.bmp) |
EHdr | ESRI .hdr Labelled |
ENVI | ENVI .hdr Labelled Raster |
GTiff | TIFF/BigTIFF/GeoTIFF(.tif) |
HFA | Erdas Imagine .img |
RST | Idrisi Raster Format |
INGR | Intergraph 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';