ST_ClipDimension

更新时间:
复制 MD 格式

ST_ClipDimension computes the pixel coordinate bounding box in raster space that corresponds to a geographic extent at a specified pyramid level.

Syntax

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

Parameters

ParameterTypeDescription
raster_objrasterThe raster object. Must have a valid spatial reference system identifier (SRID).
pyramidLevelintegerThe pyramid level at which to compute the pixel coordinates.
extentboxThe geographic extent of the clipped area in world space coordinates.

Return value

Returns a box value representing the pixel coordinate range in raster space.

Example

The following example computes the raster space bounding box of a geographic extent at pyramid level 2.

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

Output:

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

What's next

  • ST_Clip: Clip a raster object to a specified geographic extent and return the clipped raster.