I recently had some difficulties opening some MapInfo TAB vector layers in QGIS because each MapInfo layer contained two different geometry types: point and line. The MapInfo layers had originally been converted from AutoCAD DWGs. When opening in QGIS, only the point features appeared and not the linear features.

Is there a way for QGIS to open both geometries of a mixed-geometry layer? Or to convert or save them into two separate-geometry layers? Failing either of those, is there a way to specify which geometry type should be opened (in my case, I was interested in the lines and not the points)?


You can split the file into the different types using OGR2OGR:

ogr2ogr -f "MapInfo File" -where "OGR_GEOMETRY = 'Point'" yourfile_Point.Tab yourmultigeomfile.TAB

ogr2ogr -f "MapInfo File" -where "OGR_GEOMETRY = 'LineString'" yourfile_lines.Tab yourmultigeomfile.TAB
  • Thanks, but I'm getting syntax errors when I try that in the python console. I don't speak python. I think it's in the filename references. I'm on Windows, so the file paths have spaces, which is could the problem. What's the best way to refer to source and destination files on Windows? I've looked through various OGR and QGIS wikis, but I'm bewildered! – blackthorn Jul 21 '12 at 7:50
  • @blackthorn This is not python. It's a command line statement which should be easy to execute in Windows using OSGeo command line. – underdark Jul 21 '12 at 8:34
  • Ah, yes. Thanks for the clarification. Works nicely in the OSGeo4W command shell. – blackthorn Jul 21 '12 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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