All Products
Search
Document Center

PolarDB:ST_ExportTo

Last Updated:Aug 20, 2026

Exports a raster object to an Object Storage Service (OSS) bucket, a Multi-Cloud Object Storage (MinIO) bucket, or a Hadoop Distributed File System (HDFS) file.

Syntax

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

Parameters

ParameterDescription
sourceThe raster object to export.
formatThe format of the exported data. Common values: GTiff, BMP.
urlThe path of the external file. Subset is not supported. For more information, see Object storage paths.
levelThe pyramid level.
The format parameter specifies the name of the export format. Common formats are listed below.
NameFull name
BMPMicrosoft Windows Device Independent Bitmap(.bmp)
ECWERDAS Compressed Wavelets (.ecw)
EHdrESRI .hdr Labelled
GIFGraphics InterchangeFormat(.gif)
GPKGGeoPackage
GTiffTIFF/BigTIFF/GeoTIFF(.tif)
HDF4Hierarchical Data Format Release 4 (HDF4)
PDFGeospatial PDF
PNGPortable Network Graphics (.png)
COGCloud optimized GeoTIFF

Description

Returns true if the export succeeds and false if it fails.

You can call the ST_RasterDrivers function to query supported data types.

Examples

-- Export to OSS
Select ST_ExportTo(raster, 'GTiff', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.tif')
from raster_table
where id=1;

-- Export to MinIO
Select ST_ExportTo(raster, 'PNG', 'MIO://<ak>:<ak_secret>@10.0.XX.XX:443/mybucket/data/image.png')
from raster_table
where id=1;

-- Export to HDFS
Select ST_ExportTo(raster, 'PNG', 'HDFS://<user_name>@10.0.XX.XX:8020/path/image.png')
from raster_table
where id=1;