將一個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';