Skip to content

Instantly share code, notes, and snippets.

@beingsane
Forked from isaqueprofeta/capitais.json
Created April 17, 2020 18:25
Show Gist options
  • Save beingsane/9c54f0633638d6c666459e557817525b to your computer and use it in GitHub Desktop.
Save beingsane/9c54f0633638d6c666459e557817525b to your computer and use it in GitHub Desktop.
Capitais do Brasil para o plugin worldmap-panel do Grafana
[
{
"key" : "SE",
"name" : "Sergipe",
"latitude" : -10.9091,
"longitude" : -37.0677
},
{
"key" : "PA",
"name" : "Pará",
"latitude" : -1.4554,
"longitude" : -48.4898
},
{
"key" : "MG",
"name" : "Minas Gerais",
"latitude" : -19.9102,
"longitude" : -43.9266
},
{
"key" : "RR",
"name" : "Roraima",
"latitude" : 2.82384,
"longitude" : -60.6753
},
{
"key" : "DF",
"name" : "Distrito Federal",
"latitude" : -15.7795,
"longitude" : -47.9297
},
{
"key" : "MS",
"name" : "Mato Grosso do Sul",
"latitude" : -20.4486,
"longitude" : -54.6295
},
{
"key" : "MT",
"name" : "Mato Grosso",
"latitude" : -15.601,
"longitude" : -56.0974
},
{
"key" : "PR",
"name" : "Paraná",
"latitude" : -25.4195,
"longitude" : -49.2646
},
{
"key" : "SC",
"name" : "Santa Catarina",
"latitude" : -27.5945,
"longitude" : -48.5477
},
{
"key" : "CE",
"name" : "Ceará",
"latitude" : -3.71664,
"longitude" : -38.5423
},
{
"key" : "GO",
"name" : "Goiás",
"latitude" : -16.6864,
"longitude" : -49.2643
},
{
"key" : "PB",
"name" : "Paraíba",
"latitude" : -7.11509,
"longitude" : -34.8641
},
{
"key" : "AP",
"name" : "Amapá",
"latitude" : 0.034934,
"longitude" : -51.0694
},
{
"key" : "AL",
"name" : "Alagoas",
"latitude" : -9.66599,
"longitude" : -35.735
},
{
"key" : "AM",
"name" : "Amazonas",
"latitude" : -3.11866,
"longitude" : -60.0212
},
{
"key" : "RN",
"name" : "Rio Grande do Norte",
"latitude" : -5.79357,
"longitude" : -35.1986
},
{
"key" : "TO",
"name" : "Tocantins",
"latitude" : -10.24,
"longitude" : -48.3558
},
{
"key" : "RS",
"name" : "Rio Grande do Sul",
"latitude" : -30.0318,
"longitude" : -51.2065
},
{
"key" : "RO",
"name" : "Rondônia",
"latitude" : -8.76077,
"longitude" : -63.8999
},
{
"key" : "PE",
"name" : "Pernambuco",
"latitude" : -8.04666,
"longitude" : -34.8771
},
{
"key" : "AC",
"name" : "Acre",
"latitude" : -9.97499,
"longitude" : -67.8243
},
{
"key" : "RJ",
"name" : "Rio de Janeiro",
"latitude" : -22.9129,
"longitude" : -43.2003
},
{
"key" : "BA",
"name" : "Bahia",
"latitude" : -12.9718,
"longitude" : -38.5011
},
{
"key" : "MA",
"name" : "Maranhão",
"latitude" : -2.53874,
"longitude" : -44.2825
},
{
"key" : "SP",
"name" : "São Paulo",
"latitude" : -23.5329,
"longitude" : -46.6395
},
{
"key" : "PI",
"name" : "Piauí",
"latitude" : -5.09194,
"longitude" : -42.8034
},
{
"key" : "ES",
"name" : "Espírito Santo",
"latitude" : -20.3155,
"longitude" : -40.3128
}
]
-- Teste usando o datasource do PostgreSQL
-- Usar 'Timeseries' na metrica
-- EXEMPLO 01:
-- Não é necessário tabelas, apenas o banco com o Datasource
SELECT NOW() AS time,
'SP' AS metric,
5 AS value
GROUP BY metric
-- EXEMPLO 02:
-- Dica de select para consulta em ambiente 'mais proximo do real':
SELECT dados.tempo AS time,
estados.uf AS metric,
count(dados.valor) AS value
FROM dados
JOIN estados ON estados.uf = dados.uf
WHERE dados.valor > 0
GROUP BY metric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment