MapInfo Tab to Tableau

567 views
Skip to first unread message

David Orsi

unread,
May 5, 2015, 11:29:41 AM5/5/15
to mapi...@googlegroups.com
I have some boundary files that I need to put into Tableau format for a customer and I am having a hard time doing so. Can anyone advise?

Greg

unread,
May 6, 2015, 4:51:09 AM5/6/15
to mapi...@googlegroups.com
Hi David,
 
I've done this using Tableau Public and some UK admin boundary data, though it was some time ago.  From memory, you need to create a list of lat/long coords that make up each region.  This is then imported into Tableau and used to link to the data that is to be mapped.  I followed some instructions on the Tableau website; somehting like this - http://kb.tableau.com/articles/knowledgebase/polygon-shaded-maps
 
I think I wrote some code to export the coordinates from MapInfo in the correct format, though I can't find the source code, otherwise I would share it!  There's also a limit to the number of nodes, which I exceeded on my first attempt.
 
HTH
 
Greg

MEHMET HINC

unread,
May 6, 2015, 7:24:13 AM5/6/15
to mapi...@googlegroups.com
Hi David,

I was using below simple MapBasic code to create tableau formatted data in mapinfo and then export it to txt and then import.

----------- Polygon Export ----------

select * from BerBre into sel1 noselect

Set CoordSys earth projection 1,104 'table sel1

dim o as object
dim i,j,k as integer
dim sName as String

k= 1
fetch first from Sel1
do while not eot(Sel1)
o = Sel1.obj
i = Sel1.rowid
sName = Sel1.Name
for j=1 to ObjectInfo(o,20)
 Insert Into Tableau_Export (NAME,LONG,LAT,DRAW_ORDER) Values (sName+"_"+k,ObjectNodeX(o, 1, j), ObjectNodeY(o, 1, j),j)
next

k = k + 1

fetch next from Sel1
loop


------

BR,
Mehmet

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Orsi

unread,
May 6, 2015, 9:55:13 AM5/6/15
to mapi...@googlegroups.com
Mehmet,

Thank you for your time.

I do have some questions as I am not very proficient in MapBasic myself.

- Is the "BreBre" the name of the table you were working with?
- What if myt columns differ from yours in your code? Is not not relevant because they have to match what you provided or is it  simply what your columns were named?
- If I wanted to run this script for an entire table called "Territory" would I replace where your script says, Sel1 with the name of my table, and if so do I still need to loop?

Thank you again for your time!

David

MEHMET HINC

unread,
May 26, 2015, 10:01:04 AM5/26/15
to mapi...@googlegroups.com
Hi David,

Sorry my late reply, There is an always public holiday in Germany, I hate to do vacations in here due to bs weather :) anyway here it is

- Is the "BreBre" the name of the table you were working with?
     Yes exactly, e.g. settlement areas

- What if myt columns differ from yours in your code? Is not not relevant because they have to match what you provided or is it  simply what your columns were named?
   Depend on your table structure for sure my tableau data is like Name, longitude , latitude and drawing order (this should be from 1st to last point). I use directly MapInfo's function to extract node coordinates of my polygons nothing special.

- If I wanted to run this script for an entire table called "Territory" would I replace where your script says, Sel1 with the name of my table, and if so do I still need to loop?
   Sel1 basically short form for my table. It is some kind of my style because unfortunately all table names that come from outside of my company come with very long naming so it is a habit to select everything and put them into a temporary table such as "Sel1" :)

I think if you do the same for your table i think it will be working correctly. Please don't forget that my table contains only polygons , disaggregated polygons so basically simple geometry. If you have complex object than you need to modify to code to do the same thing for that case. However If I am not wrong Tableau does not support this, if you have this kind of polygons than we need to modify the structure... Little bit of extra mapinfo work :)

Br,
Mehmet
Reply all
Reply to author
Forward
0 new messages