Difference between revisions of "Tutoriais por Pedro Costa"
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| Line 11: | Line 11: | ||
3º Passo: Sintaxe da query:  | 3º Passo: Sintaxe da query:  | ||
| − | <syntaxhighlight>  | + | <syntaxhighlight lang="sql">  | 
select count(*), portugal.municipio  | select count(*), portugal.municipio  | ||
Revision as of 09:03, 15 April 2011
Quantas estradas existem sem qualquer tipo de classificação, por concelho?
1º Passo: Importar shapefile da CAOP com os concelhos: [1]
2º Passo: Converter para o Sistema de coordenadas da Base de Dados descarregada do OSM
3º Passo: Sintaxe da query:
<syntaxhighlight lang="sql">
select count(*), portugal.municipio from planet_osm_roads, portugal where highway is null and st_contains (way, way) group by portugal.municipio order by count (planet_osm_roads) desc
</syntaxhighlight>
4º Passo: Alterar highways sem classificação para "unclassifield":
<syntaxhighlight lang="sql">
update planet_osm_roads set highway = 'unclassified' where planet_osm_roads.highway is null
</syntaxhighlight>