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 OSS raster files.

Description

The path of OSS files is in the following format: oss://access_id:secrect_key@endpoint/path_to/file. The endpoint parameter can be omitted, and the system automatically finds the corresponding endpoint. If the endpoint parameter is omitted, the path must start with a forward slash (/).

The endpoint is the address used to access OSS. To properly import data, make sure that the ApsaraDB for PolarDB instance is in the same region as the OSS bucket. For more information, see OSS endpoints.

Examples

-- Specifies the AccessKey ID, AccessKey secret, and endpoint based on OSS.
Select ST_CreateRast('OSS://ABCDEFG:1234567890@oss-cn.aliyuncs.com/mybucket/data/4.tif');

-- Specifies the AccessKey ID and AccessKey secret based on OSS.
Select ST_CreateRast('OSS://ABCDEFG:1234567890@/mybucket/data/4.tif');

-- Specifies the URL in HTTPS format based on OSS. AccessKey-based access has better performance than URL-based access.
Select ST_CreateRast('https://mybuckets.oss-cn.aliyuncs.com/data/4.tif');