ST_HMTAsRaster

更新时间:
复制 MD 格式

Converts a heatmap tile into a raster object for viewing and computation.

Syntax

raster ST_HMTAsRaster(bytea hmt, text storageOption default '{}');

Parameters

Parameter

Description

hmt

A heatmap tile in Protobuf binary format.

storageOption

The storage parameters for the raster object. If chunk_table is not specified, an anonymous temporary table is used. For more information, see ST_CreateRast.

Description

  • Converts a heatmap tile into a raster object for viewing and computation. The input heatmap tile must be created with the ST_AsHMT function.

  • The resulting raster object inherits the spatial reference from the input heatmap tile.

Examples

CREATE TABLE test_table AS 
SELECT i num,
    ST_SetSRID(ST_MakePoint((i-0.5)::numeric, (i-0.5)::numeric), 4326) geom,
    i*100::int4 weight,
    i*i*i::float8 volume
FROM generate_series(1, 10) i;

SELECT ST_HMTAsRaster(ST_AsHMT(geom, --geometry type
    ST_MakeEnvelope(0, 0, 10, 10, 4326), -- Extent 
    10,        -- Width, in pixels
    10         -- height, in pixels
))
FROM test_table;
---------