将一个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)
ECW ERDAS Compressed Wavelets (.ecw)
EHdr ESRI .hdr Labelled
GIF Graphics InterchangeFormat(.gif)
GPKG GeoPackage
GTiff TIFF/BigTIFF/GeoTIFF(.tif)
HDF4 Hierarchical Data Format Release 4 (HDF4)
PDF Geospatial PDF
PNG Portable Network Graphics (.png)

示例

Select ST_ExportTo(raster, 'GTiff', 'OSS://ABCDEFG:[email protected]/mybucket/data/4.tif') from raster_table where id=1;