2 384
edições
m (→Novo processo) |
(→Geração da grade: osmc.grid_generate_all_levels_logistic rodar por fragmento de mil) |
||
Linha 81: | Linha 81: | ||
DECLARE | DECLARE | ||
tpl text; | tpl text; | ||
cover_frag text[]; | |||
lev numeric; | lev numeric; | ||
s text :=''; | s text :=''; | ||
Linha 93: | Linha 94: | ||
) t | ) t | ||
$$; | $$; | ||
FOR cover_frag IN ( | |||
select array_agg(x) | |||
from unnest(p_contry_cover) WITH ORDINALITY t(x,ord) | |||
group by ord/1000 | |||
) LOOP | |||
FOR lev IN (select x from generate_series(p_lev0, p_lev_max, 2.5) t(x)) LOOP | |||
END LOOP; | IF lev>p_lev0 THEN s := s || E'\n UNION ALL \n'; END IF; | ||
s := s || format(tpl, lev::text, p_contry, cover_frag::text, p_contry_base::text); | |||
END LOOP; -- lev | |||
END LOOP; -- cover_frag | |||
s := s|| E'\n ORDER BY 1'; | s := s|| E'\n ORDER BY 1'; | ||
RETURN QUERY EXECUTE s; | RETURN QUERY EXECUTE s; |
edições