1

I'm trying to read MapInfo files using GDAL instead of MITAB library - https://github.com/mapgears/mitab.

With the MITAB C API I can call mitab_c_get_type() to identify the feature object type, and if it's a text type, get the text string by calling mitab_c_get_text().

Is there any way I can read this data by calling exported functions from GDAL? If this is a wrong approach, how would you handle reading MapInfo text type?

3
  • You may look at GetMapInfoType e.g github.com/OSGeo/gdal/blob/… and GetTextString github.com/OSGeo/gdal/blob/… . Not into C code most of the time so not sure.
    – ThomasG77
    Commented Feb 18, 2021 at 11:53
  • These functions aren’t exported, so they’re not callable. MITAB exports them in mitab_capi.h, but this library hasn’t seen maintenance in 8 years. Commented Feb 18, 2021 at 12:57
  • We have actually maintained MITAB.DLL and you can get latest version from here: routeware.dk/download/mitab_170d.7z, which contains both 32 and 64-bit dll's. Next version 1.7.0e is close to being released. Commented Feb 9, 2023 at 8:27

2 Answers 2

1

You can't directly import .tab text layers into QGIS, but if you are able to use MapInfo Universal Translator, you can translate your layers to DWG. Then you should import this DWG in QGIS. In the finish you will get your text in .gpkg format retaining symbology of text objects (including the colour and size of font). This approach is good enough.
If you haven't MapInfo Universal Translator, you can also use geospatial data online converter:
https://mygeodata.cloud/converter/
choose input and output data formats
enter image description here
A few examples of available coversions:
MapInfo .tab to DXF https://mygeodata.cloud/converter/mapinfo-to-dxf
MapInfo .tab to KML https://mygeodata.cloud/converter/mapinfo-to-kml
MapInfo .tab to DGN https://mygeodata.cloud/converter/tab-to-dgn
But there is a limitation 5 MB per month from your computer (this website remembers your IP-address, but you can use VPN to use this online converter after exceeding the limit)

0

In the GDAL API, there are many possible types for geometry objects (see enum OGRwkbGeometryType), but "text" is not one of them. Text objects are unique to MapInfo.

To make MapInfo files compatible with other GISes, convert text objects into points/lines that are to be labelled.

1
  • It is possible to retain MapInfo .tab text annotations in QGIS if you have access to the MapInfo Universal Translator. You can export your .tab text annotation layers to the DWG (2007 in my testing) format and then in QGIS import that DWG into a GeoPackage. In the finish you will get those text features retaining symbology including the colour, orientation and size of font.
    – KVO
    Commented Aug 7, 2021 at 5:23

Your Answer

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

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