This function creates a raster object based on Alibaba Cloud Object Storage Service (OSS).

Syntax

raster ST_CreateRast(cstring url);

Parameters

Parameter Description
url The path of the OSS raster object.

Description

You can specify the URL of the OSS object in the following format: oss://access_id:secret_key@endpoint/path_to/file. The endpoint is optional. If you do not specify the endpoint, the system can automatically find the corresponding endpoint. If the endpoint is omitted, you must start the directory of the OSS object with a forward slash (/).

The endpoint is the domain name that you can use to access the OSS bucket where the OSS object is stored. To guarantee that data is correctly imported, you need to ensure that the ApsaraDB RDS for PostgreSQL instance is in the same region as the OSS bucket. For more information, see OSS endpoints.

Examples

-- Specify the AccessKey ID, AccessKey secret, and endpoint in the URL of an OSS object to create a raster object.
Select ST_CreateRast('OSS://ABCDEFG:1234567890@oss-cn.aliyuncs.com/mybucket/data/4.tif');

-- Specify the AccessKey ID and AccessKey secret in the URL of an OSS object to create a raster object.
Select ST_CreateRast('OSS://ABCDEFG:1234567890@/mybucket/data/4.tif');

-- Specify the HTTPS URL of an OSS object to create a raster object. The performance is better if you use an AccessKey to access OSS.
Select ST_CreateRast('https://mybuckets.oss-cn.aliyuncs.com/data/4.tif');