Title: RE: [MI-L] polygon overlay(calculating area share from differentpolygons)

Hi,

This should do the trick:

Select TABLE_A.ID, TABLE_B.ID, CartesianArea(Overlap(TABLE_A.OBJ, TABLE_B.OBJ), "sq m")  "AREA_SQ_M"
        From TABLE_A, TABLE_B
        Where TABLE_A.OBJ Intersects TABLE_B.OBJ

You might also want to add this condition to remove all the cases where an OBJ in TABLE_A only intersects an OBj in TABLE_B

        And CartesianArea(Overlap(TABLE_A.OBJ, TABLE_B.OBJ), "sq m") > 0

You can run the entire SQL Statement from the MapBasic window or use the SQL Select dialog:

Select Columns:         TABLE_A.ID, TABLE_B.ID, CartesianArea(Overlap(TABLE_A.OBJ, TABLE_B.OBJ), "sq m")  "AREA_SQ_M"
From Table(s):          TABLE_A, TABLE_B
Where                           TABLE_A.OBJ Intersects TABLE_B.OBJ
                                        And CartesianArea(Overlap(TABLE_A.OBJ, TABLE_B.OBJ), "sq m") > 0

HTH,

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of shamas
Sent: Sunday, March 19, 2006 2:11 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] polygon overlay(calculating area share from differentpolygons)

Greetings all

I am a beginner user of MapInfo. The problem looks to be simple but I am stuck with it.

I have two maps with polygons say table A and B. I want to calculate which polygons from table B overlay each polygon in table A and what is the share of area from corresponding polygons in Table B.

I have tried to use update column and join the table using the "polygon from Table A intersects Polygon from Table B" but it just returns one polygon from the Table B intersecting with polygon from table A while others are not.

I would much appreciate if someone can help me with this problem.

Regards
Shamas



_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l


_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to