Imports an Object Storage Service (OSS) object to a raster object in Ganos.

Syntax

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

Parameters

Parameter Description
chunkTableName The name of the chunk table. The name must comply with the table naming conventions of Ganos.
url The URL of the OSS object. For more information, see the description of the url parameter in ST_CreateRast.
storageOption A JSON string that is used to specify the storage information of the raster object.
importOption A JSON string that is used to specify the import-related parameters. Ganos supports the parallel parameter. This parameter specifies the degree of parallelism. The data type of this parameter is INTEGER. The value of this parameter ranges from 1 to 64. If you do not specify the parallel parameter, the value of the GUC parameter ganos.parallel.degree is used as the default degree of parallelism. For more information, see ganos.parallel.degree.

The following table describes the parameters of the storageOption parameter.

Parameter Type Default value Description
chunking boolean true Specifies whether to store the data as chunks.
chunkdim string The value is the same as the value for the original data. The dimensions that are used to chunk data. Format: (w, h, b).
Note This parameter takes effect only when you set the chunking parameter to true.
compression string lz4 The format that is used to compress the data of the OSS object. Valid values:
  • none
  • jpeg
  • zlib
  • png
  • lzo
  • lz4
  • snappy
  • zstd
  • jp2k
quality integer 75 The quality of compression. This parameter is valid only for the JPEG and JPEG 2000 compression formats.
interleaving string The value is the same as the value for the original data. The method that is used to interleave the data of the OSS object. Valid values:
  • bip : Band interleaved by pixel
  • bil : Band nterleaved by pixel
  • bsq : Band Sequential
blockendian string 'NDR' The sequence that is used to store the bytes in each data chunk. Valid values:
  • NDR: little endian
  • XDR: big endian
celltype string The value is the same as the value for the original data. The pixel type of the raster object. Valid values:
  • 1bb: 1 bit
  • 2bui: 2-bit unsigned integer
  • 4bui : 4bit unsigned integer
  • 8bs : 8bit signed integer
  • 8bui : 8bit unsigned integer
  • 16bsi : 16bit signed integer
  • 16bui : 16bit unsigned integer
  • 32bsi : 32bit signed integer
  • 32bui : 32bit unsigned integer
  • 32bf : 32bit float
  • 64bsi : 64bit signed integer
  • 64bui : 64bit unsigned integer
  • 64bf : 64bit float

Description

This function is used to create a raster object and import an OSS object into the created raster object.

The following table lists the data types that are supported by this function.

Data type 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
netCDF Network Common Data Form
AAIGrid Arc/Info ASCII Grid
AIG Arc/Info Binary Grid
GIF Graphics Interchange Format
PNG Portable Network Graphics
JPEG JPEG JFIF File Format

Examples:

-- Specify only the name and path of the OSS object that you want to import.
Select ST_ImportFrom('chunk_table','OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.tif');

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

-- Specify the size per chunk and the compression format during the import process.
Select ST_ImportFrom('chunk_table','OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.tif', '{"chunkdim":"(128,128,3)", "compression":"none"}');

-- Specify the degree of parallelism at import.
Select ST_ImportFrom('chunk_table','OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/data/image.nc:hcc', '{}', '{"parallel": 4}');