ST_BestPyramidLevel

更新时间:
复制 MD 格式

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

ParameterTypeDescription
rastrasterThe raster object. Must have a valid spatial reference system identifier (SRID).
extentBoxThe world space of the viewport, in the format ((minX,minY),(maxX,maxY)).
widthintegerThe width of the viewport, in pixels.
heightintegerThe 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