All Products
Search
Document Center

PolarDB:ST_HMTAsRaster

Last Updated:Feb 29, 2024

This topic describes the ST_HMTAsRaster function. This function converts heatmap tiles into raster objects for easier viewing and computing.

Syntax

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

Parameters

Parameter

Description

hmt

The heatmap tile binary based on protobuf.

storageOption

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

Description

  • This function converts heatmap tiles into raster objects for easier viewing and computing. Heatmap tiles are generated by using the ST_AsHMT function.

  • The spatial reference here must be the same as the spatial reference in the heatmap.

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 pixel
    10        -- height
))
FROM test_table;
---------