1

I want to convert a tab file created with MapInfo to an ESRI Shapefile (.shp) using ogr2ogr in command line.

I did the following

ogr2ogr -f 'ESRI Shapefile' "file.shp" "file.tab"

but it gives an error:

Unable to open datasource `file.tab' with the following drivers.

I use gdalv2.4

Do I have to specify anything else?

  • 3
    did you try: ogr2ogr -f "ESRI Shapefile" file.shp file.tab i think the problem is because you are mixing " and '. the filenames don't need to be in quotes were as the file type option -f has to be. – zwnk Jun 26 at 17:24
4

The following both commands should work with double quotes "" surrounding the file format "ESRI Shapefile" and with or without double quotes "" surrounding the files names:

ogr2ogr -f "ESRI Shapefile" "file.shp" "file.tab"

Or

ogr2ogr -f "ESRI Shapefile" file.shp file.tab

But using single quotes '' surrounding the file format 'ESRI Shapefile' will raise an error:

Unable to open datasource `file.shp' with the following drivers (in my case).
1

Not sure if you got this working but the easiest way is to use QGIS which is essentially a GUI for ogr2ogr. If you load in your .TAB file into QGIS you can right click in the layers panel and click

Export > Save Features As..

From here you can select a number of formats to save as.

Chris

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.