ST_ExportTo
更新时间:
复制 MD 格式
Exports a raster object to Object Storage Service (OSS) as an OSS object.
Syntax
boolean ST_ExportTo(raster source,
cstring format,
cstring url,
integer level = 0);Parameters
| Parameter | Description |
|---|---|
| source | The raster object to export. |
| format | The format of the exported file, such as GTiff or BMP. See Supported formats for all valid values. |
| url | The OSS URL of the output object. For the URL format, see the url parameter description in ST_CreateRast. |
| level | The pyramid level to export. Default value: 0. |
Description
Returns true if the raster object is exported successfully, or false if the export fails.
Supported formats
The format parameter accepts the following GDAL driver codes:
| Format code | 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 |
Examples
The following example retrieves a raster object from raster_table and exports it to OSS as a GeoTIFF file.
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';该文章对您有帮助吗?