All Products
Search
Document Center

AnalyticDB:Load raster data

Last Updated:Oct 28, 2024

This topic describes how to load a raster data file from your on-premises computer or an Object Storage Service (OSS) bucket into GanosBase by using the ST_ImportFrom function.

Usage notes

Your AnalyticDB for PostgreSQL instance must be authorized to access the raster data file. If the raster data file is stored in an OSS bucket, make sure that your AnalyticDB for PostgreSQL instance is deployed in the same region as the OSS bucket. For more information, see OSS domain names.

ST_ImportFrom

The ST_ImportFrom function is used to load a raster data file from your on-premises computer or an OSS bucket into GanosBase.

Note
  • In addition to the ST_ImportFrom function, GanosBase provides other raster-related functions. For more information, see Raster SQL Reference.

  • For information about the parameters of the ST_ImportFrom function, see ST_ImportFrom.

Syntax

INSERT INTO <raster_table_name>(<raster_column_name>) VALUES (ST_IMPORTFROM('<chunk_table_name>','<path_to_raster_file>'))

Examples

  1. Create an extension named Ganos_Raster.

    CREATE EXTENSION Ganos_Raster CASCADE
  2. Load a raster data file from your on-premises computer into GanosBase.

    INSERT INTO raster_table(name, rast) VALUES ('local_file', ST_ImportFrom('chunk_table', '/home/beijing.tif'));
  3. Load a raster data file from an OSS bucket into GanosBase.

    INSERT INTO raster_table(name, rast) VALUES ('oss_file', ST_ImportFrom('chunk_table', 'oss://ak:as@bucket/data/beijing.tif'));