[postgis-users] area resulting from ST_Within

surya storma-ipb at indo.net.id
Sat Sep 20 19:37:13 PDT 2008


Dear List,

I have two  tables, one table contains   5 polygons depicting 5 watersheds 
or river basin boundaries. Another table contain district bondaries. Using 
ST-contain function below, I have obtained districts belong to a certain 
watershed . My qestion is how to calculate area of each district contained 
in a certain watershed using sum(area)(), taking into consideration that one 
district might be splitted in two or more different watershed

SELECT watersheds.name, districts.name
FROM watersheds, districts
WHERE ST_contains (watersheds.the_geom, districts.the_geom)
GROUP BY watersheds.name, districts.name ;

best regards,

surya




More information about the postgis-users mailing list