osmc:CM/SQL: mudanças entre as edições

Linha 13: Linha 13:
   
   
<syntaxhighlight lang="sql">
<syntaxhighlight lang="sql">
CREATE TABLE grid_cm.l0 AS
DROP TABLE IF EXISTS grid_cm.l0
;
CREATE TABLE grid_cm.l0 (
  LIKE osmc.tflike_decode_scientific_absolute_geoms
  INCLUDING ALL
);
INSERT INTO grid_cm.l0 AS
   SELECT *  
   SELECT *  
   FROM osmc.decode_scientific_absolute_geoms('f,1,2,3,4,5,6,7,8,9,a,b,c,d,e','CM',16)
   FROM osmc.decode_scientific_absolute_geoms(
;
        '1,2,3,4,5,6,7,8,9,a,b,c,d',
        'CM',
        16
  );
</syntaxhighlight>
</syntaxhighlight>
A lista de de geocódigos é conhecida, faz parte da configuração do país, fixada no [https://git.afa.codes/CM/blob/main/conf.yaml#L37 git oficial do país], como ''grid_l0_cell_sci_base''.
A tabela gerada tem a seguinte estrutura:
<pre>
    Column    |  Type  | Description                                 
----------------+----------+-------------------
code          | text    | Geocode, withoutout the country prefix.
area          | real    | Area in squared meters
side          | real    | Cell side size, in meters
truncated_code | text    | ?
base          | text    | ?
geom          | geometry | Original geometri, in the native SRID projection.
geom4326      | geometry | Expanded geometry with no projection, with more points to avoid efeito varal.
</pre>