ST_ImportFrom

Updated at:
Copy as MD

Imports an Object Storage Service (OSS) object to a raster object in AnalyticDB for PostgreSQL.

Syntax

raster ST_ImportFrom(cstring chunkTableName,
                     cstring url,
                     cstring storageOption default '{}',
                     cstring importOption default '{}');

Parameters

ParameterTypeDefaultDescription
chunkTableNamecstringRequiredThe name of the chunk table. The name must comply with the table naming conventions of AnalyticDB for PostgreSQL.
urlcstringRequiredThe URL of the OSS object to import. For the URL format, see the url parameter in ST_CreateRast.
storageOptioncstring'{}'
importOptioncstring'{}'

Supported formats

ST_ImportFrom supports the following raster formats:

Format codeFull name
BMPMicrosoft Windows Device Independent Bitmap (.bmp)
EHdrESRI .hdr Labelled
ENVIENVI .hdr Labelled Raster
GTiffTIFF/BigTIFF/GeoTIFF (.tif)
HFAErdas Imagine .img
RSTIdrisi Raster Format
INGRIntergraph Raster Format
NetCDFNetwork Common Data Form
AAIGridArc/Info ASCII Grid
AIGArc/Info Binary Grid
GIFGraphics Interchange Format
PNGPortable Network Graphics (.png)
JPEGJPEG JFIF File Format

Examples

Import a GeoTIFF file from OSS:

Select ST_ImportFrom('chunk_table','OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.tif');

Import a NetCDF file and specify a subset:

-- Specify an OSS object that is in NetCDF and contains a subset.
Select ST_ImportFrom('chunk_table','OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.nc:hcc');