This project is read-only.

mapinfo tab support

Oct 4, 2011 at 2:05 AM

Hi,

Just starting out with dotspatial.  I can't seem to open a MapInfo tab format file.  I am able to open shapefiles.

Any advice would be appreciated.

e.g.   FeatureSet fs = (FeatureSet)FeatureSet.Open(@"c:\temp\test.tab");   // works with a shapefile

Thanks,

Alberto

Oct 16, 2011 at 6:21 PM

Any ideas would be really helpful.

Oct 17, 2011 at 6:28 PM

It looks like these files are supported by GDAL: http://www.gdal.org/ogr/drv_mitab.html

Does this help?

Oct 18, 2011 at 3:54 PM

I've tried searching through the tutorials/discussions and don't see any examples of opening anything other than a shape file.   I've added the Data Extensions folder to my bin directory and can open shape files.

The test project is a simple console app in .NET 4.0 (x86).   The error I get is "The specified file type is not supported."

Is there something extra I need to do in my project setup to enable .tab support.  

Oct 19, 2011 at 3:30 AM

I've tried separately adding *.tab to 

DialogReadFilter

on

GdalImageProvider

and on

GdalRasterProvider

without any luck getting GDAL to load the sample TAB file I had.

It might require some work to determine why gdal isn't opening the file and whether a new provider for the TAB file would need to be written.

Nov 21, 2011 at 11:25 AM

I have had a play and got .TAB files to load using the OGRExtension

A whole load of OGR dlls required (I just used FWTools - clearly there is a lot of overlap with GDAL as well - but not worked out how to streamline that yet)

Once everything was in place all that was required was:

            DotSpatial.Data.OgrExtension.OgrVectorProvider o = new DotSpatial.Data.OgrExtension.OgrVectorProvider();

            DotSpatial.Data.IFeatureSet f =  o.Open("c:/temp/MI/VC.tab");           

   map1.MapFrame.Add(f);

 

Except ....

That the OgrExtension crashes as (in my tab files anyway) the record [0] always seemed to be null - which made it think it had finished.

There appears to maybe be a 0/1 array base issue.

For a test I just added one to the _iFeatureIndex if it was < 1 in the Read method in OCRDataReader.cs - it then all loaded OK