Load raster data
Updated at:
Copy as MD
Use ST_ImportFrom to load a raster data file from an on-premises computer or an Object Storage Service (OSS) bucket into GanosBase.GanosGanosGanosGanos
For a full list of raster-related functions, see Raster SQL reference. For
ST_ImportFrom parameters, see ST_ImportFrom.Prerequisites
Before you begin, make sure that you have:
An AnalyticDB for PostgreSQL instance that is authorized to access the raster data file
If loading from OSS, an OSS bucket in the same region as your AnalyticDB for PostgreSQL instance (see OSS domain names)
Syntax
INSERT INTO <raster_table_name>(<raster_column_name>) VALUES (ST_IMPORTFROM('<chunk_table_name>','<path_to_raster_file>'))Load from an on-premises computer
Create the
Ganos_Rasterextension.CREATE EXTENSION Ganos_Raster CASCADELoad the raster file.
INSERT INTO raster_table(name, rast) VALUES ('local_file', ST_ImportFrom('chunk_table', '/home/beijing.tif'));
Load from an OSS bucket
Create the
Ganos_Rasterextension if you haven't already.CREATE EXTENSION Ganos_Raster CASCADELoad the raster file using the OSS URI format.
INSERT INTO raster_table(name, rast) VALUES ('oss_file', ST_ImportFrom('chunk_table', 'oss://ak:as@bucket/data/beijing.tif'));
Next steps
Is this page helpful?