All Products
Search
Document Center

ApsaraDB RDS:ST_RPCRectify

Last Updated:Mar 28, 2026

Rectifies a raster object using rational polynomial coefficients (RPC) and returns the rectified raster.

Syntax

raster ST_RPCRectify(raster rast,
                     raster dem DEFAULT NULL,
                     cstring rectifyOption DEFAULT '{}',
                     cstring storageOption DEFAULT '{}',
                     cstring parallelOption DEFAULT '{}')

Parameters

ParameterTypeDefaultDescription
rastrasterThe raster object to rectify. Must contain RPC information.
demrasterNULLA digital elevation model (DEM) to reference during rectification.
rectifyOptioncstring (JSON)'{}'Rectification options.
storageOptioncstring (JSON)'{}'Storage options for the output raster.
parallelOptioncstring (JSON)'{}'Parallel processing options.
Note The input raster object must contain RPC information.

rectifyOption parameters

ParameterTypeDefaultDescription
resamplestringNearThe resampling method. Valid values: Near, Average, Cubic, Bilinear.
outSridintegerSame as sourceThe spatial reference ID (SRID) of the output raster.
nodataValuefloat8 or float8[]NULLThe nodata value for the output raster. Specify a single value to apply it to all bands, or an array (for example, [0, 0, 0]) with one element per band. If not set, the value defaults to the source raster's nodata value, or 0 if the source has none.
RPC_DEM_MISSING_VALUEfloat80The height value to use when the dem parameter has a nodata value or the pixel falls outside the valid DEM extent.

storageOption parameters

ParameterTypeDefaultDescription
chunkingbooleanSame as sourceSpecifies whether to store the output raster as chunks.
chunkdimstringSame as sourceThe chunk dimensions. Takes effect only when chunking is true.
chunktablestring''The name of the chunk table. Set to '' to create a temporary chunk table with a random name in the current session. Temporary tables are deleted when the session ends. Specify a name to persist the output raster beyond the session. If the parallel method does not support anonymous chunk tables, create the chunk table in advance.
compressionstringSame as sourceThe compression format. Valid values: NONE, JPEG, ZLIB, PNG, LZO, LZ4, JP2K.
qualityintegerSame as sourceThe compression quality. Applies only to JPEG compression.
interleavingstringSame as sourceThe band interleaving method. Valid values: bip (band interleaved by pixel, BIP), bil (band interleaved by line, BIL), bsq (band sequential, BSQ).
endianstringSame as sourceThe byte order of the output raster. Valid values: NDR (little endian), XDR (big endian).

Examples

CREATE TABLE IF NOT EXISTS raster_table(id integer, rast raster);

-- Load the RPC raster.
INSERT INTO raster_table VALUES(1, ST_ImportFrom('t_chunk', '<RAST_DATA_DIR>/rpc.tif', '{}'));

-- Load the DEM raster.
INSERT INTO raster_table VALUES(2, ST_ImportFrom('t_chunk', '<RAST_DATA_DIR>/rpc_dem.tif', '{}'));

CREATE TABLE raster_result(id integer, rast raster);

-- Rectify without a DEM, using nearest neighbor (NNS) resampling.
INSERT INTO raster_result(id, rast)
SELECT 10, ST_RPCRectify(
    rast,
    NULL,
    '{"resample": "Near"}',
    '{"chunking": true, "chunkdim": "(256,256,1)", "interleaving": "bsq", "chunktable": "t_chunk"}'
)
FROM raster_table
WHERE id = 1;

-- Rectify with a DEM and output in EPSG:32635, using 8 parallel workers.
INSERT INTO raster_result(id, rast)
SELECT 11, ST_RPCRectify(
    rast,
    (SELECT rast FROM raster_table WHERE id = 2),
    '{"resample": "Near", "outSrid": 32635}',
    '{"chunking": true, "chunkdim": "(256,256,1)", "interleaving": "bsq", "chunktable": "t_chunk"}',
    '{"parallel": 8}'
)
FROM raster_table
WHERE id = 1;