Skip to content

Instantly share code, notes, and snippets.

@Ferdev
Created August 10, 2010 16:39
Show Gist options
  • Save Ferdev/517559 to your computer and use it in GitHub Desktop.
Save Ferdev/517559 to your computer and use it in GitHub Desktop.
update named_areas as na SET area_protected = (
select
ST_Area(ST_Intersection(ST_Union(pa.the_geom), temp.the_geom))
from named_areas_protected_areas as napa, protected_areas as pa, (select id from named_areas where id=na.id) as temp
where napa.protected_area_id=pa.id AND named_area_id AND named_area_id = temp.id )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment