4

I am trying to convert some TAB files into Shapefiles by using QGIS. After I import the TAB files, and make sure that these have the correct CRS, it is possible to observe that the spatial data can be exported into a shapefile.

However, and regardless of the tab file imported, the data in attribute table is always missing. Therefore, the only way for me to correctly import a tab file into QGIS, both geometrical and attribute data, is by using Universal Translator (UT).

Attribute Tables from the same TAB and UT converted file

Is it possible to import both geometry and attribute tables from TAB to SHP, using QGIS?

Here is a sample of the data I am working with (tab files). Sample TAB file

2 Answers 2

3

If you open your tab files with a text editor, you see there is only one field. What you call attributs seems to be informations for labelling

enter image description here

For exemple, i open an other file (cours_eau.tab), and the import works fine:

enter image description here

3

You can study your data with ogrinfo

ogrinfo "cut numbers.tab" -al 
INFO: Open of `cut numbers.tab'
      using driver `MapInfo File' successful.

Layer name: cut numbers
Geometry: Point
Feature Count: 206
Extent: (583187.850000, 266081.960000) - (583488.020000, 266389.950000)
Layer SRS WKT:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["OSGB_1936",
            SPHEROID["Airy 1930",6377563.396,299.3249646],
            TOWGS84[375,-111,431,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",49],
    PARAMETER["central_meridian",-2],
    PARAMETER["scale_factor",0.9996012717],
    PARAMETER["false_easting",400000],
    PARAMETER["false_northing",-100000],
    UNIT["Meter",1.0]]
blank: String (1.0)
OGRFeature(cut numbers):1
  blank (String) =
  Style = LABEL(t:"12025",a:0.000000,s:0.655312g,c:#000000,p:1,f:"")
  POINT (583487.07 266168.230271857)

The report means that your MapInfo file contains text strings as labels, not as attributes. I believe it would be possible to convert the contents of labels into normal attributes with GDAL and some Python scripting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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