ST_BestPyramidLevel
更新时间:
复制 MD 格式
Computes the optimal pyramid level for rendering a raster object within a viewport, based on the viewport's spatial extent and pixel dimensions.
Syntax
integer ST_BestPyramidLevel(raster rast, Box extent, integer width, integer height);Parameters
| Parameter | Type | Description |
|---|---|---|
rast | raster | The raster object. |
extent | Box | The world space of the viewport, in the format ((minX,minY),(maxX,maxY)). |
width | integer | The width of the viewport, in pixels. |
height | integer | The height of the viewport, in pixels. |
Usage notes
The raster object must have a valid spatial reference system identifier (SRID).
Examples
Retrieve the best pyramid level for a viewport that spans from (128.0, 30.0) to (128.5, 30.5) at 800×600 pixels:
SELECT ST_BestPyramidLevel(raster_obj, '((128.0, 30.0),(128.5, 30.5))', 800, 600)
FROM raster_table
WHERE id = 10;Result:
3该文章对您有帮助吗?