[postgis-users] calculating area from geometry intersections

Nelson Guda nelsong at mail.utexas.edu
Wed May 17 12:42:27 PDT 2006


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



More information about the postgis-users mailing list