3

I have a .tab file with a ridiculous amount of columns (96). One of my colleagues at my new job wanted to update them manually one by one. I told him I could do that in an easier way using PostGIS. So I told him to give me the data and let me do my thing.

I converted the .tab file to a shapefile, uploaded the shapefile to PostGIS, uploaded a table to PostGIS with the data which was needed for the update. I updated all the 96 columns at once and achieved the wanted ending in a table in PostGIS. He wanted it back in a .tab file.

I exported the file as a shapefile, which went perfect. Then I export the file as a .tab file using QGIS. So I figured I had the end result and have send it to my colleague. He checks it and reports back to me that the last 10 columns are empty, which they should not be. Also the coordinates differ and the polygons are not in the same location as they were in the original file in MapInfo, which he uses.

I checked it in QGIS and there is no problem at all. The columns are filled, the polygons overlap with the original data. I am totally perplex.

I know that my coordinate system RD new sometimes differs in code. I remember adding a small line of text in the formula to align it once. So I guess the movement of the coordinates is something I can fix myself. But why do columns appear empty while they are not in QGIS?

And why can some .tab files I export in QGIS not be opened in MapInfo? It gives an error the moment I open the .tab file.

I am researching myself, but I need some guidance to find the right direction to research further to. I'd love some help and that is why I ask the question here.

2 Answers 2

2

Based on your comments to MappaGnosis's answer, it looks like you're just trying to join 2 tables. This is easily done in MapInfo and would save you a whole load of grief trying to move the data between systems.

Let's say you have Table1 which has the ID and map objects in it, and Table2 which holds all the attribute information you want to apply to Table1. All you need to do is go to Query > SQL Select:

Enter the following (amended to your table and column names):

Select Columns: *

From Tables: Table1, Table2

Where: Table1.ID = Table2.ID

Into: MyJoinedTable

Then it's just a case of saving off the query results as a native MapInfo table.

1

Without seeing the data, it is difficult to say for certain why it is not working for you but here are a couple of things to consider:

  1. The reason the polygons could appear misplaced sounds very much like one of projection. It is possible that the MapInfo file has lost its projection along the way and QGIS is maybe coping better with reprojecting on the fly. Did you give ALL the files to your colleague including the PRJ if there was one?
  2. I wonder if the encoding of the data in the final columns is not compatible with MatInfo (e.g. UTF vs LATIN) but readable by QGIS and Postgresql??

Finally, you appear to have 'gone round the houses' during your conversion process and each additional step is a potential source of error or loss of projections (especially where a shapefile is concerned). I'd prefer to do this conversion in two fewer steps and use OGR2OGR to go straight to Postgres and then OGR2OGR again to go straight from PG back to MapInfo.

That said - while I am not a MapInfo user I am very surprised that MapInfo doesn't have some facility to do bulk edits on the columns. You can in both QGIS and ArcGIS (which possibly precludes the need to even convert to PostGIS, though you may need a little Python magic). I'd always understood MapInfo to be a very capable GIS and would have expected that this could all be done using MapBasic

3
  • Well I dont want to burn down mapinfo, I am very unfamiliar with it and my colleague wanted the end result as soon as possible. So I immediatly went to postgis which is what I know. He wanted to keep the geometry and one unique id field. All the other columns should come from a table without a geometry and be linked based on that similar unique ID column. He has been working with mapinfo for a few years so I guess this is not easily done in it. I did not research that path. Thank you for the tip to skip the shapefile part!
    – Zuenie
    Commented May 9, 2016 at 20:54
  • 1
    And I did need to change the encoding to latin1 to upload it to postgis. This is a good lead.
    – Zuenie
    Commented May 9, 2016 at 20:56
  • 1
    'bulk edit on the columns' in MapInfo : Table/Update Column...
    – sys49152
    Commented May 10, 2016 at 5:37

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