Difference between revisions of "QGIS com Postgresql"
Jump to navigation
Jump to search
| (5 intermediate revisions by the same user not shown) | |||
| Line 15: | Line 15: | ||
=== Do OpenStreetMap para Postgresql === | === Do OpenStreetMap para Postgresql === | ||
| − | [[Importação de | + | [[Importação das farmácias de Braga no OpenStreetMap]] |
=== De shapefile para Postgresql === | === De shapefile para Postgresql === | ||
| Line 22: | Line 22: | ||
== Estilos == | == Estilos == | ||
| + | |||
| + | Dados importados do portal [http://www.geosaude.dgs.pt/websig/v5/portal2/public/index.php?par=geosaude Geosaúde], e convertidos do sistema de coordenadas EPSG:3857 (PSEUDO MERCATOR) para EPSG:3763. ndicador: Nascimentos em mulheres adolescentes | ||
| + | |||
| + | [[File:Legenda personalizada.png]] | ||
[[Guardar e recuperar estilos]] em base de dados | [[Guardar e recuperar estilos]] em base de dados | ||
| Line 29: | Line 33: | ||
=== Consultas simples em SQL === | === Consultas simples em SQL === | ||
| − | === | + | <syntaxhighlight lang="sql"> |
| + | select * from pontos | ||
| + | where fclass = 'pharmacy' | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === Consultas mais sofisticadas em SQL === | ||
| + | |||
| + | <syntaxhighlight lang="sql"> | ||
| + | select pontos.id, pontos.name as nome, st_buffer(pontos.geom, 500) as geom | ||
| + | from pontos, caop | ||
| + | where caop.concelho = 'BRAGA' and st_contains(caop.geom, pontos.geom) | ||
| + | and pontos.fclass = 'pharmacy' | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Triggers == | ||
== Notificações Postgresql == | == Notificações Postgresql == | ||
Latest revision as of 09:08, 14 January 2019
Ligação ao Postgresql
QGIS → Layer → Add layer → Add PostGIS Layers...
Preencher o diálogo como na imagem, substituindo o IP por: xxx.xxx.xxx.xxx
Importação de dados
De KML para Postgresql
Do OpenStreetMap para Postgresql
Importação das farmácias de Braga no OpenStreetMap
De shapefile para Postgresql
Importação da CAOP 2016 da Madeira
Estilos
Dados importados do portal Geosaúde, e convertidos do sistema de coordenadas EPSG:3857 (PSEUDO MERCATOR) para EPSG:3763. ndicador: Nascimentos em mulheres adolescentes
Guardar e recuperar estilos em base de dados
Consultas com o Gestor de Base de dados
Consultas simples em SQL
select * from pontos
where fclass = 'pharmacy'
Consultas mais sofisticadas em SQL
select pontos.id, pontos.name as nome, st_buffer(pontos.geom, 500) as geom
from pontos, caop
where caop.concelho = 'BRAGA' and st_contains(caop.geom, pontos.geom)
and pontos.fclass = 'pharmacy'
Triggers
Notificações Postgresql
Não seria incrível poder atualizar o layer se houver mudanças na base de dados?
http://oslandia.com/en/2017/10/07/refresh-your-maps-from-postgresql/

