[postgis-users] calculating area from geometry intersections

Bruce Rindahl rindahl at lrcwe.com
Wed May 17 12:51:41 PDT 2006


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




More information about the postgis-users mailing list