All Products
Search
Document Center

:ST_CostUnion

Last Updated:Apr 03, 2024

This topic describes the ST_CostUnion function. This function merges all cost arrays of grids with barriers into a unified array, keeps the highest cost for overlapping grids, ensures that only one cost value is retained, and merges cost arrays of degenerate grids.

Syntax

gridcost[] ST_CostUnion(gridcost[]barriers);

Parameters

Parameter

Description

barriers

The cost array of grids.

Description

This function merges all cost arrays of grids with barriers into a unified array, keeps the highest cost for overlapping grids, ensures that only one cost value is retained, and merges cost arrays of degenerate grids.

Examples

select st_costunion(array[st_setcost(array[st_gridfromtext('GZ01')],1), st_setcost(array[st_gridfromtext('GZ0')],5)]);

----------------------------
 {"({0102400100000000},5)"}