GDAL - How to get geometry type of a MapInfo TAB file?

المشرف العام

Administrator
طاقم الإدارة
I am using the OGR MapInfo File driver to read a MapInfo TAB file. However, the function GetGeomType() returns 0 which means 'wkbUnknown` even if the features in the TAB are only multi-polygons.

Is it because MapInfo TAB can store many different GeomTypes in the same file?

If I take for granted that only one geometry type would always be in the TAB, how could I retrieve it?

driver = ogr.GetDriverByName("MapInfo File") datasource = driver.Open(os.path.join(dirname,shapefileName)) layer = datasource.GetLayer(0) geometryType = layer.GetGeomType() >>>geometryType >>>0

أكثر...
 
أعلى