Load raster data
This topic describes how to use the ST_ImportFrom function to load a raster image file from a local file system or from Object Storage Service (OSS) into Ganos.
Considerations
The instance must be able to access the raster image. If the data is stored in OSS, make sure that the ApsaraDB instance and the OSS data are in the same region, as described in OSS domain names.
ST_ImportFrom function
ST_ImportFrom is a Ganos_Raster function that loads a raster image file stored in a local file system or in OSS into Ganos.
This topic covers only the basic load syntax and its description. Additional capabilities are described in the documentation of the corresponding tool.
Detailed descriptions of the
ST_ImportFromparameters are available in ST_ImportFrom.
Syntax
INSERT INTO <raster_table_name>(<raster_column_name>) VALUES (ST_IMPORTFROM('<chunk_table_name>','<path_to_raster_file>'))Examples
Create the ganos_raster extension.
CREATE EXTENSION Ganos_Raster CASCADELoad a raster file from a local file system into Ganos.
INSERT INTO raster_table(name, rast) VALUES ('local_file', ST_ImportFrom('chunk_table', '/home/beijing.tif'));Load a raster image file from OSS into Ganos.
INSERT INTO raster_table(name, rast) VALUES ('oss_file', ST_ImportFrom('chunk_table', 'oss://ak:as@bucket/data/beijing.tif'));