Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcellobenigno/4664572 to your computer and use it in GitHub Desktop.
Save marcellobenigno/4664572 to your computer and use it in GitHub Desktop.
-- QUANDO OS DADOS ESTIVEREM EM COORDENADAS GEOGRÁFICAS, PARA REALIZAR A MEDIÇÃO DE DISTÂNCIAS E DE ÁREAS,
-- DEVE-SE UTILIZAR O COMANDO Geography(geom), EX. :
SELECT ST_Distance(Geography(a.geom), Geography(b.geom))/1000 as dist_km,
ST_Area(Geography(a.geom)) AS a1, ST_Area(Geography(b.geom)) AS b1
FROM municipios_pb a, municipios_pb b
WHERE a.nome = 'Patos' AND b.nome = 'Campina Grande';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment