Last active
August 29, 2015 14:03
-
-
Save gledsoncruz/f8a9ea13e141850a48b2 to your computer and use it in GitHub Desktop.
soma_areas_ocupadas_por_zonas
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
SELECT b.id, ROUND(SUM(ST_AREA(e.the_geom)/1000)::numeric,2) as area_ocupada, | |
ROUND(ST_AREA(b.the_geom)::numeric/1000,2) as area_zona | |
FROM areas_ocupadas e, gis.zoneamentos b | |
WHERE ST_INTERSECTS(e.the_geom, b.the_geom) | |
GROUP BY b.id, b.the_geom | |
ORDER BY b.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment