Skip to content

LIXO, tags

Peter edited this page Oct 26, 2018 · 3 revisions

Criar arquivo com contagens das mais frequentes


select count(*) 
from planet_osm_rels  where tags->>'type' ='boundary' and tags?'IBGE:GEOCODIGO';

.. buscar polygons dentro dessas rels e depois conferir se tags ainda funcionam resultando no mesmo conjunto... lembrar que municipios poderiam ser ways.


SELECT x, count(*) n FROM (
  SELECT jsonb_object_keys(pw.tags) x 
  FROM  planet_osm_rels pw
) t group by 1 
HAVING count(*)>10 
ORDER BY 2 desc,1;

Resultados:

            x             |   n    
--------------------------+--------
 type                     | 151092
 restriction              |  51095
 name                     |  39245
 source                   |  28047
 building                 |  25530
 boundary                 |  24748
 admin_level              |  23506
 natural                  |  14623
 landuse                  |  14329
 height                   |  13647
 IBGE:GEOCODIGO           |  12254
 ref                      |   7411
 population               |   6215
 wikidata                 |   6169
 wikipedia                |   6018
 route                    |   5976
 place                    |   5669
 operator                 |   5496
 network                  |   4596
 addr:street              |   4166
 addr:housenumber         |   3630
 public_transport:version |   3165
 source:population        |   3120
 border_type              |   2899
 public_transport         |   2801
 leisure                  |   2647
 amenity                  |   2301
 from                     |   2007
 to                       |   1998
 water                    |   1707
 waterway                 |   1697
 alt_name                 |   1543
 fixme                    |   1442
 addr:neighbourhood       |   1287
 addr:city                |   1137
 level                    |   1109
...
 official_name:cs         |     12
 official_name:es         |     12
 ref:vatin                |     12
 seamark:harbour:category |     12
 smoking                  |     12
 source_ref               |     12
 train                    |     12
 url                      |     12
 wood                     |     12
 CARACTERIS               |     11
 ESPECIEPRE               |     11
 branch                   |     11
 collection               |     11
 construction             |     11
 fax                      |     11
 generator:source         |     11
 heritage                 |     11
 motorcycle               |     11
 name:als                 |     11
 name:bm                  |     11
 name:co                  |     11
 name:hak                 |     11
 name:szl                 |     11
 name:tzl                 |     11
 name:zu                  |     11
 official_name:ru         |     11
 plant:output:electricity |     11
 roof:levels              |     11
 social_facility:for      |     11
(465 rows)
SELECT x, count(*) n FROM (
  SELECT jsonb_object_keys(pw.tags) x 
  FROM  planet_osm_ways pw
) t group by 1 
HAVING count(*)>10 
ORDER BY 2 desc,1;

RESULTADO:

                    x                    |    n    
-----------------------------------------+---------
 building                                | 3609417
 highway                                 | 3444253
 source                                  | 2431350
 name                                    | 1717979
 height                                  | 1517099
 surface                                 | 1024012
 oneway                                  |  689894
 natural                                 |  265175
 waterway                                |  228953
 addr:street                             |  225279
 landuse                                 |  211263
 maxspeed                                |  197234
 lanes                                   |  171482
 addr:housenumber                        |  143310
 leisure                                 |  136290
 ref                                     |  129114
 building:levels                         |  103875
 amenity                                 |   98654
 access                                  |   94474
 addr:city                               |   90239
 service                                 |   89339
 source:name                             |   85281
 layer                                   |   81545
 lit                                     |   71587
 addr:suburb                             |   68996
 addr:postcode                           |   66121
 bridge                                  |   66023
 barrier                                 |   61378
 roof:shape                              |   60447
 operator                                |   49374
 water                                   |   45903
 intermittent                            |   45899
 roof:colour                             |   45780
 horse                                   |   42262
...
 operator:wikidata                       |      12
 passenger_information_display           |      12
 recycling:batteries                     |      12
 sanitary_dump_station                   |      12
 source:leisure                          |      12
 source:spelling                         |      12
 wifi                                    |      12
 addr:door                               |      11
 alt                                     |      11
 alt_name:pt                             |      11
 colonnade:right                         |      11
 contact:google_plus                     |      11
 dance:teaching                          |      11
 department                              |      11
 hazard_prone                            |      11
 hazard_type                             |      11
 highway:2001-2002                       |      11
 horse_scale                             |      11
 incorrect:leisure                       |      11
 nod8                                    |      11
 oneway:cycleway                         |      11
 parts                                   |      11
 path                                    |      11
 rail                                    |      11
 railway:name                            |      11
 railway:ref                             |      11
 recycling:glass_bottles                 |      11
 recycling:newspaper                     |      11
 service:vehicle:brakes                  |      11
 service:vehicle:tyres                   |      11
 shoulder:smoothness                     |      11
 source:maxweight                        |      11
 ur                                      |      11
 vehicle:conditional                     |      11
 wikipedia:es                            |      11
 windows                                 |      11