Hi list

I don't think some of the responses to my request went to the list, and I
felt some were excellent, thanks guys. I'm posting them now for the benefit
of others who are still in the learning process...

=================================================================

Hi Dan,

You do have options doing this with SQL:

MB help:

AreaOverlap( ) funtion:

Purpose

Returns the area resulting from the overlap of two closed objects.

Syntax:

AreaOverlap ( object1, object2 )

object1 and object2 are closed objects.

Return Value

A Float value representing the area (in MapBasic's current area units - use

Set Area Units... to change this) of the overlap of the two objects.

Example:

Select AreaOverlap(PolygonTable1.Obj, PolygonTable2.Obj) , PolygonTable1.ID,

PolygonTable2.ID

Received: From PolygonTable1, PolygonTable2

Where PolygonTable1.Obj Intersects PolygonTable2.Obj

Into a Noselect

Browse * From a

ProportionOverlap( ) function:

Purpose

Returns a number that indicates what percentage of one object is covered by

another object.

Syntax

ProportionOverlap(object1,object2)

object1 is the bottom object (not text or points)

object2 is the top object (not text or points)

Return Value

A Float value equal to Area(Overlap(object1,object2) ) / Area(object1).





HTH

S�ren Breddam


=================================================================

Hi,

I'd recommend you do this as follows:

i) make a copy of the veg layer

ii) split the veg layer into separate polygons for each corridor, NP or SF

do this as follows:

make veg layer editable

select all veg polygons

Objects > Set Target

select all corridors

Objects > Split

save table, then Table > Maintenance > Pack

repeat procedure for NP and SF

iii) use SQL similar to this:

For summary areas by class for all veg layer:

Select class, sum(area(obj, "hectare")) "Area_ha" from veg group by class

order by class into selArea1 NoSelect

For veg areas within NP etc

Select sum(area(obj, "hectare")) from veg where obj within (select obj from

NP) into selArea2 NoSelect

For the percentages of each veg class

Select sum(area(obj, "hectare")) from veg where obj within (select obj from

NP) group by class order by class into selArea3 NoSelect

then you'll need to divide areas from selArea3 by areas in selArea1 to get %

(use "sq km", or "sq m" instead of "hectare" as required)



Fiddly, but very powerful. There's plenty of scope for modifying and

extending the SQL above to do exactly what you need.

Hope this helps.

Best Regards,

Martin Higham

Avantra Geosystems


=================================================================

Cheers

Dan Bowles

Reply via email to