[postgis-users] help with sql - calc area of polygons within map view

Jennifer Strahan jennifer at greeninfo.org
Tue Sep 23 12:33:57 PDT 2008


Hi Everyone,

I'm hoping someone can offer guidance on writing an sql statement. 

I'm working on a Google maps interface to display protected lands in 
California.  As the user moves the map, I'd like to calculate the total 
area of protected lands within the current map view.  I'm able to get 
the map bounds as lat/lon and pass that to the script.  I'm not sure how 
to do processing though.  Do I need to use ST_Union to get the union of 
the map frame and the polygons, then get the area of that?  Any examples 
on how to write the SQL would be very helpful.  By the way I have 
multiple geometry columns in my table, one that is CA teale albers 
(the_geom_ca_albers), and one that is web mercator (the_geom_google).

Thanks,
Jennifer



More information about the postgis-users mailing list