[postgis-users] calculating area from geometry intersections

Stephen Woodbridge woodbri at swoodbridge.com
Wed May 17 13:04:45 PDT 2006


Nelson,

Bruces query looks good, except if your data is in lat/long degrees in 
which case you will get area in square degrees, which is probably not 
useful. You will probably want to transform you data to an equiarea 
projection and compute area in terms of square feet or meters depending 
on the projection you use and then convert that to acres.

-Steve W

Bruce Rindahl wrote:
> Try:
> SELECT county.name , roadless.name, roadless.type1, roadless.type2....,
> sum(area2d(intersection(roadless.the_geom,county.the_geom))) group by
> county.name, roadless.name, roadless.type1, roadless.type2....
> 
> Adjust for your tables and column names.
> 
> Bruce Rindahl
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Nelson
> Guda
> Sent: Wednesday, May 17, 2006 1:42 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] calculating area from geometry intersections
> 
> Hi all,
> 
> I need to design a query that will return take one or more polygons  
> from one table (for example, county shapes) and return data from the  
> intersection of those polygons with polygons from another table.
> 
> More specifically, I have one table that is polygons of roadless  
> forest areas (no relation to county boundaries), and I would like to  
> assemble a query that will tell me within a given county:
> 1) the names of the roadless areas that intersect or fall within the  
> county, and
> 2) how many acres of each type of roadless area is within the county  
> (the roadless area polygons are divided into several different  
> categories)
> 
> The counties and roadless areas are the same SRID (NAD27).  I'm not  
> sure how to go about building this query, though I imagine it starts  
> with creating a temp table with an intersection command.
> 
> I've also had problems calculating area with the postgis command, but  
> I don't know what the problem is.  The number that is always way too  
> small. An example of a command I've used is:
> select sum(area(wkb_geometry))/10000 AS hectares from irasda where  
> state='WA'
> 
> Any help would be greatly appreciated.
> 
> Many thanks,
> nelson
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list