Hello,

This can be done in the mapbasic window, although it will be a bit tedious
and time consuming

MAKE A BACK UP COPY TO WORK WITH

1) do a query and set the following
    Select Columns: PU_id
    From Tables: [table name]
    Group By: PU_id
    Order By: PU_id [ this is optional ]
    Into Table: ID_LIST [ us a unique name -- NOT *SELECTION* ]

This will give you a list of all of the unique id's

open MB Window

2) enter these lines [ use Ctrl+Enter or you will run each line
individually, 2nd time DIM runs is will give error]
    DIM TheID AS STRING     '''''''' if ID is number then change STRING to
be INTEGER
    FETCH First FROM ID_List
    TheID=ID_List.COL1
3) highlight both lines and hit Enter
4) delete both lines
5) Enter the following lines changing the columns and values to what you
need
    SELECT * FROM YourTable WHERE PU_id=TheID INTO Work
    OBJECTS COMBINE DATA PU_id=PU_id,PU_area=sum(PU_area).........the rest
of your fields........
    FETCH Next FROM ID_List
    TheID=ID_List.COL1

    Replace .....rest of fields..... with what to do with each field....you
MUST do for every field
    Notice SUM() will sum total the combined *area* for your table, also
AVG() will do averages, Nothing
    just put the first objects value into the data
6) Highlight all the lines and hit Enter
7) Just keep hitting Enter until you get an error [gone past end of ID_List]
8) Delete the lines
9) Enter UNDIM TheID and hit enter.....this removes the variable from memory
[can now be DIM'ed again]

You can save the MB Window to a text file.
MI *convienently* forgot to include a *load from text*, so to reuse you will
have
to open the file in notepad and copy/paste the lines into the mb window
You can save the entire set of lines and then just highlight the lines for
each of the processes..2-3 / 5-7 / 9

If this is a continuing process, you might consider purchasing MB, or I do
custom programming [reasonable charge]
and can create a mbx program for you.

Trey Pattillo
[EMAIL PROTECTED]
http://www.wap3.com

----- Original Message -----
From: Kim Greenham <[EMAIL PROTECTED]>
To: Mapinfo-L <[EMAIL PROTECTED]>
Sent: Saturday, 24 June, 2000 22:11
Subject: MI Combining regions with common attributes


> Dear listers,
> I have a situation where I need to combine different regions which have a
> common identifier. For example, I have a Plantation Unit browser listing
> PU_id, PU_Area. Some plantation units have the same PU_id (and are
spatially
> different regions) which I need to combine into one region with the same
> PU_id and sum of PU_Area. Of course I can do this manually using the menu
> Objects/Combine, but I would like to avoid the tedious process of locating
> the duplicate PU_id's then manually selecting and combining each set.
> Hopefully some sort of SQL that I can run in the Map Basic window. Any
> assistance would be greatly appreciated.
> Kim Greenham
> Watershed Digital Mapping
> [EMAIL PROTECTED]
> RMB 1015 Denmark Western Australia  6333
> Ph 61 (08) 9848 2428 Fax 61 (08) 9848 2458
>
>
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

----------------------------------------------------------------------
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