Try using some of the more interestng object functions in combination, eg.

For each record in your database
TargetObj = Object of target polygon.
TargetRowID = Row Id of target polygon

Select * from Table Where obj Intersects TargetObj And RowID <> TargetRowID
Into Temp
If SelectionInfo(SEL_INFO_NROWS) > 0
        Fetch First From Temp
        LengthIntersection = 0
        Do Until EOT(Temp)
                AdjObj = Temp.obj
                CurrLength = ObjectLen(Overlay(ConvertToPLine(AdjObj),TargetObj),"m")
                If CurrLength > LengthIntersection
                        LengthIntersection = CurrLength
                        CombineObj = Adj
                End If
                Fetch Next from Temp
        Loop
        Update Table Set (Obj) = Combine(TargetObj,CombineObj) Where RowID =
TargetRowID
End If


Haven't tried the code so you will need to debug it.  But careful with the
loop, you could end up just combining most of you polygons into one massive
object?  I'd imaginge that these functions could also be used in a select
statement that could return the length of the intersection between each
adjoining polyygon as well....

Rob

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Jim Wilson
Sent: Wednesday, 28 March 2001 8:06 AM
To: [EMAIL PROTECTED]
Subject: MI-L Selecting region with the longest intersection


Hi all,
I'm working on a mbx to select all polygons from a table below a certain
size and combine them with the neighbour that has the longest common side. I
can easily select the polygons that are too small and by looping through
them one at a time I can select all the polygons that share a common
boundary with each one (the number of these could vary from 1 to 4)
The problem is this: How do I work out the length of the common
intersection, select the largest one, and then combine that polygon with the
one I'm currently working on in the loop?
I've looked at intersectnodes() but that creates a polyline between the
objects so I'd have to create and measure the 4 polylines at the
intersection of the polygons and then try and pick the 2 polygons to be
combined based on this figure. There must be a better way!
                        Thanks for the help (again!)

                                                Jim Wilson



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to