ThinkGeo.com    |     Documentation    |     Premium Support

Unsupported TAB format exception

Hi
I want to evaluate using TabFeatureLayer to display map overlay information:

I have created a tab file using QGis - when opening the file from code an exception is thrown:
unsupported tab format:

  • which format does ThinkGeo support ?

A the screen dump from the exception display in Visual Studio:

Visual studio source code information is within
lock (“TabFile”)
{
ValidatorHelper.CheckFileIsExist(tabPathFilename);
if (encoding == null)
{
encoding = Encoding.Default;
}
lys_003D = QSY_003D.QyY_003D.RiY_003D(tabPathFilename, encoding);
if (lys_003D == null)
{
throw new NotSupportedException(“The TAB file(s) cannot be read due to an unsupported format.”);
}
if (RequireIndex)
{
aiQ_003D();
}
IsOpenCore = true;
}

Regards
Gunnar

Hi Gunnar,

ThinkGeo should support MapInfo Tab, it’s possible we don’t support newer or more complex version of the MapInfo format (e.g., extended for 3D data or advanced features).

In the attachment you can find a tab file, which is converted from the shape file in the same folder using the following GDAL command. It loads fine using ThinkGeo. Can you try converting your file using the similar way? TabTest.zip (3.5 KB)

Let us know if you still see any issues.
Thanks,
Ben

Hi
A request for versions of tab format returns this version history - can you describe which version is implemented in ThinkGeo ?

Version History

  • Version 300: Basic, most commonly used version
    2
  • Version 400: Introduced when Metadata functions were added
    2
  • Version 410: Used for MDB ACCESS files
    2
  • Version 450: Used for XLS files and when line widths are specified in points
    2

    3
  • Version 500: Used for MIG files
    2

Version Features

  • Version 650: Introduced support for advanced printer settings, hotlinks, 3D Mapper windows, and new clip region settings
    3
  • Version 700: Added support for TAB files linked to shapefiles
    3
  • Version 1520: Included support for Web Map Service (WMS) data, advanced printer settings with scale patterns, and cartographic legends with custom layouts
    3
  • Version 1600: Introduced support for MapInfo Extended format tables (NativeX) with more than 250 columns
    3

MapInfo Extended TAB

Introduced in MapInfo Pro 15.2, the MapInfo Extended TAB format offers several advantages over the original format:

  • Support for tables larger than 2 GB
  • Unicode support
  • Ability to store attributes and geometry in one file
    4

Hi
This is the reexported files saved from QGIS: uTabReexported.zip (2.2 KB)

Hi Gunnar,

ThinkGeo
a. primarily supports basic TAB files (Version 300) and those linked to shapefiles (Version 700).
b. for *.dat file, extended the standard dbase III support to Visual FoxPro format.

ThinkGeo’s Tab should be consistent with Gdal (as well as QGis, which is backed up by Gdal. )

The TabReexported.zip you uploaded works fine using the following code, what’s the issue on your side?

        MapView.MapUnit = GeographyUnit.Feet;
        var overlay = new LayerOverlay();
        MapView.Overlays.Add(overlay);

        TabFeatureLayer.BuildIndexFile(@"d:\Downloads\TabReexported\qgisExported.tab", BuildIndexMode.DoNotRebuild);
        var layer = new TabFeatureLayer(@"d:\Downloads\TabReexported\qgisExported.tab");
        
        // Add the layer to the overlay we created earlier.
        overlay.Layers.Add(layer);

        // Create an Area style on zoom level 1 and then apply it to all zoom levels up to 20.
        layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColors.Green, GeoColors.Red);
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        // Open the layer and set the map view current extent to the bounding box of the layer.  
        layer.Open();
        MapView.CurrentExtent = layer.GetBoundingBox();

        await MapView.RefreshAsync();

Thanks,
Ben

Hi Ben
Thank you for a quick response!

It seems there is a difference in package/project/code ?
An error message appears when I try the source code:

Property or indexer ‘MapView.CurrentExtent’ cannot be assigned to – it is read only

image
My package is
image

The xaml file
xmlns:thinkGeo1=“using:LocusMobile7.Client.Controls.ThinkGeo”

<thinkgeo:MapView Grid.Row=“1” x:Name=“MapView”
SizeChanged=“MapView_OnSizeChanged” Opacity=“1”>
</thinkgeo:MapView>

Hi Gunnar,

Sorry, I was thinking you are using Desktop. Here is the Maui code:

private async void MapView_OnSizeChanged(object sender, EventArgs e)
{
if (_initialized)
return;
_initialized = true;

 MapView.MapUnit = GeographyUnit.Feet;
 var overlay = new LayerOverlay();
 MapView.Overlays.Add(overlay);

 TabFeatureLayer.BuildIndexFile(@"d:\Downloads\TabReexported\qgisExported.tab", BuildIndexMode.DoNotRebuild);
 var layer = new TabFeatureLayer(@"d:\Downloads\TabReexported\qgisExported.tab");

 // Add the layer to the overlay we created earlier.
 overlay.Layers.Add(layer);

 // Create an Area style on zoom level 1 and then apply it to all zoom levels up to 20.
 layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColors.Green, GeoColors.Red);
 layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

 // Open the layer and set the map view current extent to the bounding box of the layer.  
 layer.Open();
 MapView.CenterPoint = layer.GetBoundingBox().GetCenterPoint();
 MapView.MapScale = MapUtil.GetScale(layer.GetBoundingBox(), MapView.MapWidth, GeographyUnit.Meter);

 await MapView.RefreshAsync();

}
Here is the result on Windows:

The file path needs to be modified if working on Android/iOS

Thanks,
Ben