2 402
edições
m (→Queries) |
|||
Linha 102: | Linha 102: | ||
) t order by 10 desc, 1 | ) t order by 10 desc, 1 | ||
; -- MEDIANA 71 km2, select PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY area_per_cep) FROM (...) t2. | ; -- MEDIANA 71 km2, select PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY area_per_cep) FROM (...) t2. | ||
-- R2 | |||
SELECT substring(isolabel_ext,1,2) as pais, isolevel, lengtbit_MSB(jurisd_local_id) as bits, | |||
count(*) n | |||
FROM optim.jurisdiction where jurisd_local_id>0 | |||
GROUP by 1,2,3 order by 1, 4 desc | |||
; -- Chile (CL) cabe em 27 bits, Brasil (BR) não cabe. Poucos casos valem adaptar exceções. | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Linha 191: | Linha 198: | ||
| BR-PE-Recife || 2611606 || Recife || {50000,52999} || 3000 || 219 || 0.07 | | BR-PE-Recife || 2611606 || Recife || {50000,52999} || 3000 || 219 || 0.07 | ||
|} | |} | ||
'''R2'''. Número de bits necessários para representar jurisd_local_id. Critério para avaliar se cria artificial ou reusa no novo id. Amostrando apenas Brasil (IBGE). Reparar que somando 8 bits do país não caberia em 27. No caso do Chile caberia (15+8<27). Em função desta análise decidimos criar o ID com ROW | |||
{| class="wikitable" | |||
! país !! isolevel !! bits !! n_count | |||
|- | |||
| BR || 3 || 22 || 3861 | |||
|- | |||
| BR || 3 || 23 || 1259 | |||
|- | |||
| BR || 3 || 21 || 450 | |||
|- | |||
| BR || 2 || 5 || 12 | |||
|- | |||
| BR || 2 || 6 || 10 | |||
|- | |||
| BR || 2 || 4 || 5 | |||
|- | |||
| BR || 1 || 0 || 1 | |||
|- | |||
| ... | |||
|- | |||
| CL || 3 || 15 || 164 | |||
|- | |||
| CL || 3 || 14 || 82 | |||
|- | |||
| CL || 3 || 13 || 41 | |||
|- | |||
| ... | |||
|- | |||
| CL || 2 || 1 || 1 | |||
|- | |||
| CL || 1 || 0 || 1 | |||
|} | |||
== Table <code>optim.jurisdiction_geom</code> == | == Table <code>optim.jurisdiction_geom</code> == | ||
Geometrias de [[#optim.jurisdiction]]. Geometrias das jurisdições nacionais e locais. | Geometrias de [[#optim.jurisdiction]]. Geometrias das jurisdições nacionais e locais. |
edições