osmc:Metodologia/Algoritmo SQL: mudanças entre as edições

Linha 92: Linha 92:
== Gerando a grade L0 de cobertura do país ==
== Gerando a grade L0 de cobertura do país ==


Como vimos, as configurações são transferidas para as mesmas tabelas onde foram geradas e arquivadas as geometrias L0. Podemos simplesmente recuperá-las.
Como vimos, as configurações são transferidas para as mesmas tabelas onde foram geradas e arquivadas as geometrias L0. Podemos simplesmente recuperá-las. Tabela atual ''osmc.coverage'':
<pre>
    Column    |    Type    | Collation | Nullable | Default
---------------+-------------+-----------+----------+---------
cbits        | bit varying |          |          |
isolabel_ext  | text        |          |          |
cindex        | text        |          |          |
bbox          | integer[]  |          |          |
status        | smallint    |          |          | 0
is_country    | boolean    |          |          | false
is_contained  | boolean    |          |          | false
is_overlay    | boolean    |          |          | false
kx_prefix    | text        |          |          |
geom          | geometry    |          |          |
geom_srid4326 | geometry    |          |          |
</pre>
 
<syntaxhighlight lang="sql">
CREATE VIEW report.v002_osmc_coverage_l0_geoms AS
select isolabel_ext,cbits,
    natcod.vbit_to_baseh(substring(cbits,11)::bit varying, 16) AS cbits_b16,
    geom_srid4326
from osmc.coverage where is_country
;
</syntaxhighlight>


== Ver também ==
== Ver também ==
2 391

edições