Last active
August 29, 2015 14:24
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
--MEDIR O COMPRIMENTO DE UMA RODOVIA EM km: | |
SELECT ST_Length( | |
Geography( | |
ST_Union(geom) | |
) | |
)/1000 AS comprimento_km | |
FROM | |
rodovias | |
WHERE | |
codrodov = 'BR-230' | |
GROUP BY | |
codrodov; | |
--MEDIR UMA DISTÂNCIA ENTRE DOIS PONTOS em km: | |
SELECT ST_Distance( | |
Geography(a.geom), | |
Geography(b.geom) | |
)/1000 AS distancia_km | |
FROM | |
sedes a, | |
sedes b | |
WHERE | |
a.nome='João Pessoa' | |
AND b.nome='Campina Grande'; | |
--MEDIR UMA ÁREA EM km2: | |
SELECT ST_Area( | |
Geography(geom) | |
)/1000000 AS area_km2 | |
FROM | |
municipios | |
WHERE | |
nome='João Pessoa'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment