Sorry, I just got my computer back on-line, and haven't had time to look at
your code. However, it sounds like what you need to do is compare the
centroids of the regions, and skip those that are within x miles of each
other.
Dick
-----Original Message-----
From: McNeil, Todd (TMCNEIL)
Sent: Wednesday, August 04, 1999 2:27 PM
To: [EMAIL PROTECTED]; Neat, Richard (RLN); Crone, Tyler (TCRONE); Mead,
Richard (RMEAD); Oishi, Roy (RTO); Okunieff, Polly (POKUNIEF); Starnes,
Jeffrey (JSTARNES); Beardsley_Jr, Harry (HBEARDSL); Greig, N. Andrew
(AGREIG)
Subject: MapBasic Syntax Question
I have a block of code in whcih I am trying to write a few lines to
verify an intersection of two overlapping regions that come from two
tables. The user can select the two tables, which contain the voice
data link service stations, an they can be the same. The idea is to
automatically select the tables, which will be the same, and create
overlapping regions where the coverage area commonly intersect.
However, if the overlap is occuring at the same coverage areas, ie.
Boston with Boston, I would like to skip that process an move on to
the next .Obj. Any suggestions?
I sent this message out earlier, but almost have the problem solved.
Here is the block of code for the program:
Sub ReportProg
Dim i, iRec As Integer
Dim oFrom, oWithin, oOverlap As Object
Dim sFromCol1, sWithinCol1, sName As String
oFrom = gaObjFrom 'gsMilesFrom.obj
Select * From gsMilesWithin Where Obj Intersects oFrom
Into TempSel
For i = 1 to TableInfo(TempSel,TAB_INFO_NROWS)
Fetch Rec i From TempSel
oWithin = TempSel.Obj
oOverlap = OverLap(oFrom,oWithin)
If ObjectInfo(oOverlap, OBJ_INFO_NPNTS) > 0 Then
If oFrom.Obj = oWithin.Obj Then
Note "Object cannot overlap itself."
End If
sFromCol1 = Str$(gasFromCol1)
sWithinCol1 = Str$(gasWithinCol1)
iRec = 0
Fetch First From TempSel
Do While Not EOT(TempSel)
iRec = iRec + 1
sName = sName + TempSel.ID + " , "
Fetch Next From TempSel
Loop
If gbIsRegion Then
Insert Into Report (FromID, WithinID, Area, Perim, Num_Over,
Desc, Obj)
Values(sFromCol1, sWithinCol1, Area(oOverlap,"sq mi"),
Perimeter(oOverlap,"nmi"), iRec, sName, oOverlap)
Else 'If not a region(polyline or line) determine the
distance of the object (ObjectLen)
Insert Into Report (FromID, WithinID, Area, Perim,
Num_Over, Desc, Obj)
Values(sFromCol1, sWithinCol1,
ObjectLen(Area(oOverlap,"sq mi")),
ObjectLen(Perimeter(oOverlap,"nmi")), iRec, sName, oOverlap)
End If
End If
Next
Fetch Next From TempMilesFrom
If EOT(TempMilesFrom) Then
ProgressBar = -1
Else
ProgressBar = (gaRow - 1)
End If
End Sub
Thanks,
Todd
Annapolis Ops
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]