trino(368版本)拼接嵌套JSON
-- trino(368版本)拼接嵌套JSON
select
t2.id
,CAST(CAST(ROW(t2.coordinates, 'geometry') AS ROW("type" JSON, "Feature" VARCHAR)) AS JSON) as geojson
from (
SELECT
t1.id
,CAST(MAP(ARRAY['type','coordinates'], ARRAY['Polygon',t1.coordinates]) AS JSON) as coordinates
from ods_com_t_building_coordinates t1
where t1.building_id = '3a08c5b2-39cf-4b19-0513-d5c086409f23'
) t2
;

浙公网安备 33010602011771号