ST_ClipDimension

Updated at:
Copy as MD

Computes the raster space of a clipped area.

Syntax

box ST_ClipDimension(raster raster_obj, integer pyramidLevel, box extent);

Parameters

ParameterTypeDescription
raster_objrasterThe raster object.
pyramidLevelintegerThe pyramid level at which to compute the pixel coordinates.
extentboxThe area to clip, expressed in world space coordinates.

Usage notes

The raster object must have a valid spatial reference system identifier (SRID). Without a valid SRID, the function cannot convert world space coordinates to raster space pixel coordinates.

The function returns a box value representing the raster space of the clipped area.

Examples

The following example computes the raster space for the world space extent ((128.0, 30.0),(128.5, 30.5)) at pyramid level 2.

SELECT ST_ClipDimension(raster_obj, 2, '((128.0, 30.0),(128.5, 30.5))')
FROM raster_table
WHERE id = 10;

Result:

((200, 300),(600, 720))