Steve

You asked

> I have a table with many polygon objects.  Some of these objects have been
> combined so that even though they are geographically separate objects when
> one is selected others also select...
> So Is there a tool or procedure to go through the table an separate all
> polygons into separate objects and retain the attributes of each
object...?

This would be an interesting class exercise for a MapBasic student.

The challenge is to figure out how to "clone" the attributes for an
arbitrary table which may have up to 250 different columns of type
Char,SmallInt,Int, Float etc plus an Obj column.  Clearly you need a SQL
Insert statement to insert into the table the newly-separated objects plus
their original attributes.  However there doesn't seem to be any way to
create the appropriate Insert statement at run-time and execute it using
"Run Command"

The gotcha is that an SQL insert statement can either list the field values
to insert as literals or list them as variables.  However, you cannot use
the "literals" variant because this cannot readily describe a complex
polyline or polygon object and you cannot use the "variables" variant
because "Run command"  won't process commands containing variables!

The only solution that I ever found for this kind of problem is to resort to
the following:

dim strTable as string
dim nCols as smallInt
dim aliCol1 as alias
dim aliCol2 as alias
dim aliCol3 as alias
...
 aliCol1=strTable+".Col1"
 aliCol2=strTable+".Col2"
 aliCol3=strTable+".Col3"
....
 do case nCols
 case 1 insert into strTable(COL1,OBJ)
             values(aliCol1,objOut)
 case 2 insert into strTable(COL1,COL2,OBJ)
             values(aliCol1,aliCol2,objOut)
 case 3 insert into strTable(COL1,COL2,COL3,OBJ)
  values(aliCol1,aliCol2,aliCol3,objOut)
...
 end case

which requires 250 column alias variables to be defined and  250 insert
statements to be spelled out explicitly.

I hope that a MapBasic guru on MAPINFO-L can point out a more elegant
solution that this  :o)

By separate e-mail I'll send you a copy of a tool called disagg.mbx that
uses this method and works fine for me.

Regards

David M Haycraft
Information Analysis Associates  Pty Ltd
ABN 47 085 516 105
1 Cumming Place, Wanniassa, 2903
Aust Capital Territory,  Australia
Phone/Fax:  61 + 2 + 6231 8104
Mobile: 0412 001 134
Email:  [EMAIL PROTECTED]
Web :  www.acslink.aone.net.au/actaa/iaa.htm
A MapInfo Technology Partner







_______________________________________________________________________
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