Stephen, 

A basic adjacency matrix can be created using a sequence of sql 
commands to update columns in a table. However, there is a limit of 
250 columns which may not be enough for all the divisions in Wales. 

The table would need to contain a logical column for each division. 
The following code shows how to update that column: 

create a counter variable
        dim i as smallint
create an alias variable to refer to the table's columns
        dim colref as alias
create an object variable to use in the sql below
        dim adjobj as object    
set initial value of counter and first ( logical ) column, eg zon1
        i = 1 
        colref = zon+i

Start loop

select region
        select * from WelshDivisions where rowid  = i into target
assign selected table object to variable object
        adjobj = target.obj
Select regions adjacent to variable object but excluding itself
    select * from WelshDivisions where rowid <> i and obj intersects 
    adjobj into adjzons
For selected adjacent regions set logical column to true
        Update adjzons Set colref = 1
Update variables
        i = i + 1
        colref = zon+i

Repeat loop

If you have more than 250 regions then  you'll have to use a file 
rather than a table to record the adjacency flag. 

Ian 


- - - - - - - - - - - - - - - - -

Ian Robertson,
Information Services, E & D Dept
Leicester City Council, UK. 

Tel +44 (0) 116 252 7230
Fax +44 (0) 116 255 6385
EM: [EMAIL PROTECTED]



_______________________________________________________________________
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