not sure if this will help, but...
let's assume you have 2 region objects selected, can't you just calculate
the area of overlap, and determine whether that area is more than 50% of the
total area of the intersecting object?
this code won't werk straight off, but it should get close, and then it can
be set up in a loop to iterate through all objects. it assumes you have two
objects selected, and werks in the mapbasic window. not sure about turning
it into a single SQL query though.
###################################
Set Area Units "sq km"
Dim obj1 As Object
Dim obj2 As Object
Dim Overlap as Float
dim ObjArea as Float
Fetch first from Selection
obj1 = Selection.obj
Fetch Last from Selection
obj2 = Selection.obj
Overlap = AreaOverlap(obj1, obj2)
ObjArea = Area(obj2, "sq km")
####################################
then you need an if statement along the lines of:
####################################
if Overlap > (ObjArea / 2) then
'do your stuff here
end if
####################################
is that anything like what you were after?
(some code liberated from peter horsball muller)
note: dam, just noticed the ProportionOverlap function from robert
crossley. that might be easier.
ash
-----Original Message-----
From: Ben Crane [mailto:[EMAIL PROTECTED]
Sent: Friday, 4 July 2003 3:55 PM
To: [EMAIL PROTECTED]
Subject: MI-L Re: Majority contain SQL?
Hi all,
Anyone know how to do a SQL statement that looks for
the majority of an object within another? I have a
table of road segments, and a table of highway extents
(adopted highway). I need to check whether the road
segments just intersect (and therefore are not adopted
highway) and those where the bulk of the road segment
object is within the adopted highway table.
I can't use contain entire or contain part since even
the slightest touch counts...I'm looking for a
function that deems the majority of an object is
within another (say 50% plus)?
Ben
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 7493
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 7496