Returns the optimal pyramid level for rendering a raster at a given viewport size and spatial extent.
Syntax
integer ST_BestPyramidLevel(raster rast, Box extent, integer width, integer height)Parameters
| Parameter | Type | Description |
|---|---|---|
rast | raster | The raster object. Must have a valid spatial reference system identifier (SRID). |
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. |
Example
Find the best pyramid level for a viewport that covers the bounding box ((128.0, 30.0),(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:
st_bestpyramidlevel
---------------------
3该文章对您有帮助吗?