This function exports a raster object as an OSS object.


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


Parameter Description
source The raster object.
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.


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)
ECW ERDAS Compressed Wavelets (.ecw)
EHdr ESRI .hdr Labelled
GIF Graphics Interchange Format (.gif)
GPKG GeoPackage
GTiff Tagged Image File Format (TIFF), BigTIFF, or GeoTIFF (.tif)
HDF4 Hierarchical Data Format Release 4
PDF Geospatial PDF
PNG Portable Network Graphics (.png)


Select ST_ExportTo(raster, 'GTiff', 'OSS://') from raster_table where id=1;