‘select cid,count(cid) as 合并基站数量,string_agg(DISTINCT “行政区县”, ‘;’ ) as 涉及行政区域,string_agg(“小区网管名称”, ‘;’ ) as 基站名称,ST_ConvexHull(ST_Collect(geom)) as geom
from (SELECT *,ST_ClusterKMeans(geom,200) over () AS cid FROM (select DISTINCT on(“所属NodeB标识”) * from “铜陵3G精简拍照明细”) as cell ) as m GROUP BY cid’
1、string_agg将分组后的记录的字段进行合并
2、ST_Collect将分组后的地理位置进行地理化合并
3、ST_ConvexHull形成凸包
版权声明:本文为cuisidong1997原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。