This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select id_grid_h3, hora, ST_ASTEXT(ANY_VALUE(geometria)) wkt, count(*) n_registros, ANY_VALUE(quantidade_pessoas) populacao | |
from `rj-smtr.br_rj_riodejaneiro_onibus_gps.registros_tratada` t1 | |
join `basedosdados.br_ipea_acesso_oportunidades.estatisticas_2019` t2 | |
on st_intersects(geometria, st_geogpoint(longitude, latitude)) | |
where id_municipio in ( | |
select id_municipio | |
from `basedosdados.br_bd_diretorios_brasil.municipio` | |
where nome = 'Rio de Janeiro') | |
group by id_grid_h3, hora |