This function exports a raster object as an Object Storage Service (OSS) object.

Syntax

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

Parameters

Parameter Description
source The raster object to be exported.
format The format of the exported data, such as GTiff or BMP.
url The URL of the exported OSS object. For more information, see the description of the url parameter in ST_CreateRast.
level The pyramid level.

Description

If the raster object is successfully exported, the function returns true. If the raster object fails to be exported, the function returns false.

The format parameter specifies the format of the exported data. The following table lists the common formats.

Format Full name
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

Example

Select ST_ExportTo(raster, 'GTiff', 'OSS://ABCDEFG:1234567890@oss-cn.aliyuncs.com/mybucket/data/4.tif') from raster_table where id=1;