Knowing my luck the original email I sent will appear a few seconds after I
send this.  However as I haven't (yet) seem this come through I will send it
again.

Cheers/Apologies

Martin
==================================
Martin Roundill
GIS Manager
Waitakere City Council
Private Bag 93109
Henderson
Waitakere City
New Zealand


-----Original Message-----
From: Martin Roundill 
Sent: Thursday, 17 February 2000 15:13
To: 'Dyan Catamaran'
Cc: [EMAIL PROTECTED]
Subject: RE: MI Desagregation Method


Hi Dyan

I have had a look at this and come up with a solution that does not use
mapbasic it does however use the mapbasic window.

In the process that follows I have assumed that you have a table called
'mytable' with a field called 'MyData' that contains an integer value and
that you want to create objects that represent the overlap of the original
data with an attribute that is the sum of the data field of all polygons
that make up the overlap.

The process is as follows:
        1) Create a copy of the table (say 'mydata_original')
        2) create a blank mappable table (say 'mydata_final') with a column
(say 'data') to store the results
        3) Split the objects based on the overlaps ('mydata')
        4) get rid of slivers, save and pack the table
        5) make a copy of this table (to say 'mydata_centroid') , convert
the objects to centroids and give them a unique identifier
        6) update mydata table with the unique identifier of the
mydata_centroid where object within the shape
        7) combine the objects in 'mydata' using the unique identifier
column (from 6) into the table 'mydata_final'
        8) update the data column of mydata_final with the  sum of the
values contained in the mydata_original table
        9) QED



Right here goes in detail then:

(takes a deep breath.......)

Steps 1 and 2 should be easy.  It may be quicker with step 2 to save a copy
of the original table then delete the objects, save it and pack it.

Step 3
This is the longest process as it is dependent on the number of objects that
are in the database. Lets assume that you have 20 objects.

Type the following into the mapbasic window:

 dim i as integer
 i = 1
 select * from mydata where rowid = i into temp set target on select * from
mydata where object intersects (select object from temp) into temp2 Objects
Split Into Target i = i+ 1

repeat the last statement from "Select * from...... " to "i = i + 1" for the
number of records in the table (a text editor and a bit of copy and past may
help here)

When this is completed you will have a table of the overlaps but this is
likely to contain slivers 

step 4) The slivers will arise because the circles get converted to a series
of straight lines that represent the circle and the split function leaves
some small bits behind.  You need to get rid of these.  I would delete all
objects with an area of 0 and with an area smaller than you acceptable
tolerance.  This will require a bit of trial and error but if you use the
command:
        select area(obj,"sq m") from mydata where object into toCheck
        Browse * from toCheck

you should soon be able to determine an appropriate area as a cut off.
Delete the small areas, save the table and pack it.

Step 5
straight forward use a command like:
        update mydata_centroids set object =
createpoint(centroidx(obj),centroidy(obj)), col1 = rowid
The main thing is to end up with a table of point features that have a
unique identifier.

Step 6 
Use the update column command to update a field in mydate with the unique
identifier of the point(s) in the mydata_centroids table.  The command that
prints in the mapbasic window should look something like this:
        Add Column "mydata" (data)From mydata_centroids Set To data Where
within


Step 7
use the table/combine objects using Column.. menu option taking the objects
from my_data grouped by the unique identifier calculated in 6 and store the
data in mydata_final table (the blank table created at the beginning)

Step 8
Use the table/update column command again but this time on the mydata_final
table and calculate the sum of the data column from the mydata_original
table where the original object contains the final object

phew..............................


All done.  Of course it would be easier with mapbasic.

I have included two images of the results (original and final).
<<I have removed these from the forwarded email as they appear to stop the
email going through the MapInfo List server - if anyone wants to see them
please email me directly
[EMAIL PROTECTED]>>>


I hope this is on track with what you want because my head is beginning to
spin. ;}

Cheers


Martin

-----Original Message-----
From: Dyan Catamaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 17 February 2000 05:49
To: [EMAIL PROTECTED]
Subject: MI Desagregation Method


Hi

Thanks for all of you that answered my simple question on DELETE issue.

Here is another.

This problem is hunting me. I would like to have more options for
Desegregation Method something like ADD, AVERAGE, etc.

Back ago I posted a question on splitting polygons using the three rings as
an example. Unfortunately, I didn't get any reply. The question still the
same. Basically, I want split two (or much more) intersecting Buffer rings
and add their attributes.

I attached a GIF image (26KB) that explains graphically the scenario. I
don't have MB so developments out of "My Bag of Tricks" using the MBW are
out of my reach.

Any help is wellcome and sub-contract is an option.

Thanks

Dyan C. Catamaran
Phero Tech Inc.
--------------------------
604-940-9944
604-940-9433

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to