[gdal-dev] mapinfo driver - polygon geometries

Cemal Koplay ckoplay at gmail.com
Tue Mar 18 05:08:39 PDT 2014


Hi,

I want to ask a question for the mapinfo(mitab) driver. When i try to open
a .tab file whose geometry type is polygon, OGRFeatureDefn::GetGeomType
method for layer object return wkbUnknown instead of wkbPolygon. When i
search for the mitab_tabfile.cpp for the geometry type parsing code, i
encounter with this block of code in the TABFile::Open method .

        int numPoints=0, numRegions=0, numTexts=0, numLines=0;

        GetFeatureCountByType( numPoints, numLines, numRegions, numTexts);

        numPoints += numTexts;
        if( numPoints > 0 && numLines == 0 && numRegions == 0 )
            m_poDefn->SetGeomType( wkbPoint );
        else if( numPoints == 0 && numLines > 0 && numRegions == 0 )
            m_poDefn->SetGeomType( wkbLineString );
  else
            /* we leave it unknown indicating a mixture */;

the case for  the "numPoints == 0 && numLines == 0 && numRegions > 0" is
missing. So polygon support is missing. When i add this case to code and
set the geomtype as polygon, the driver works fine for polygon files. Is
this a bug or is it intentionally missing?

Thanx.

cemal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140318/bb455a4b/attachment.html>


More information about the gdal-dev mailing list