They are Census Block layers. The person on the website separated them into states so they can be download easier. I uploaded each states separate layer into MapInfo.

Now I need to merge the files into one US Layer.

They all have the same table structure and fields. I just downloaded MapBasic but I am unsure how to really use it.
I tried to laso the layers to select them all and then just save the selected. Only works on the top layer.

Please help! Thank you all for your help in advance!


If you have (or are willing to begin using) Quantum GIS, you can use the "Vector->Merge Shapefiles" tool (under the vector menu).

| improve this answer | |

If you don't mind doing a bit of grunt work and if you are only doing it once the you could just open all the tables and do Table -> Append Rows to Table. This will give you a dialog asking which table you want to append to what, so just choose one of the states to append everything to and go through appending each one, one at a time, to this 'master' table. To make this a bit quicker and easier I would suggest following these steps;

1) Open all your individual layers (You can open them in 'No View' to keep everything a bit tidier) and make sure you have nothing else open.

2) Go to Table -> Append Rows to Table

3) (This step will save you loads of time) Make sure you leave the 'To Table' as whatever the default one is. This means that everytime you open this dialog you won't have to choose a different 'To Table', you'll just have to change the 'Append Table'

4) Change the Append table to the first one in the list that isn't the same one as in the 'To Table'!

5) Repeat from step 2, changing the 'Append Table' drop down to the next one.

Once you've done all this, whatever your 'To Table' was will contain everything, and you can then save a copy of this as 'All' or something similar.

I'm sure there is a better way, especially if you learn a bit of MapBasic, but if you want a quick and dirty solution then this should work. It's what I do whenever I have a couple of tables to combine that have the same structure. Addmittedly I've never done 48 tables so this might be a touch too much grunt work.

I swear I wrote a little MapBasic tool to do just this, but I can't for the life of me find it. If I do I'll update my answer, if not there are a few MapBasic gurus buzzing around here that will probably be able to put together an easy script.

EDIT: I did find the tool, it wasn't one I made, it was one I downloaded called 'COMB_TAB.mbx', but I can't find it anywhere on the internets and I can't upload it since I am at work and everythings blocked! There is another tool out there, but I haven't tried it, might be worth a go. - http://mapinfotools.com/index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=8&sobi2Id=34&Itemid=53

There is also this Google Groups discussion that talks about an 'appender.mbx' tool that might be hanging around as part of your MapInfo install, but again, I couldn't find it

| improve this answer | |

Similar to @Rob Quincey - there is this tool called append2.mbx. I've used this one on similar projects to yours.

  • Basically, run the mapBasic program from within MapInfo
  • Append will appear as a new menu
  • Click Append > Append Tables
  • Explore to you directory containing the tables and add all
  • Click Append - and specify a new file name for a new mapinfo table containing all appended records
| improve this answer | |

If you wanted to incorporate this into a MapBasic application you could do something like this:

Insert into all_states select * from alabama
Insert into all_states select * from alaska
Insert into all_states select * from arizona

Alternatively, you could import a table containing a list of all the states and then run a loop which would append each one.

fetch first from list_of_states
do while NOT EOT(list_of_states)
    tabName = list_of_states.col(1)
    Insert into all_states select * from tabName
    fetch next from list_of_states

In this case, you'd have a table with 1 column containing the name of the state/table name.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.