Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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)?

Thanks,

George

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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