Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to convert a MapInfo file to an ESRI shapefile using GDAL's ogr2ogr command as described here, but I am getting the following error:

Unable to open datasource `Iceland2pts.mif' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> a bunch more drivers listed...

Just to be sure I have updated my GDAL install to the latest version (1.10.1) on Ubuntu, so I'm thinking it has to do with the format of the file (due to this), but I just don't know enough about these to know what is going wrong.

Example format of MapInfo file:

Charset "WindowsLatin1"
        -22.556955         64.777794
        -22.555510         64.782730
        -22.544556         64.779297
        -22.546009         64.777359
        -22.493431         64.767670
        -22.486217         64.774597
        -22.483826         64.772453
        -22.486826         64.768799
        -22.493431         64.767670

Does the formatting look incorrect, or is something else eschew?


Update: Example of the possible MID header

Charset "WindowsLatin1"
        -23.8252        65.7438
        -23.8289        65.7445
        -23.8355        65.7472
        -23.8421        65.7503
        -23.8477        65.7531
share|improve this question

From the MapInfo site:

MIF/MID format is comprised of two files, one with an extension of MIF, the other with the same name, but the extension MID. The MIF file contains the actual points that represent the objects, while the MID file contains the text information about the objects.

The MapInfo MIF format specification notes that the .mid is optional, but the GDAL/OGR documentation refers to "a pair of .MIF + .MID files" and a quick test using a MIF with no MID shows that ogrinfo fails when the MID is missing.

It looks like your MIF is not supposed to have an associated MID (i.e COLUMNS 0) so it seems like this is a bug in GDAL/OGR. I've opened a ticket (and in only a few hours it's been fixed in trunk scheduled for release in GDAL 2.0).

share|improve this answer
Thanks Luke. I had thought that I had two different MIF files, as one had the extension .mif and the other .MIF, but perhaps this is the MID file you refer to. I will include the header of this file to my post for more info and give your suggestion a shot. Thanks for filing the bug report! – ryanjdillon Jul 1 '13 at 14:26
@shootingstars no, that 2nd file is a MIF, the format specs I linked to explains the difference. MIFs have the header and geometry, MIDs have only the attributes. Your files do not have MIDs and gdal/ogr cannot open them. A workaround might be to add a dummy column, see example MIF and create a dummy MID with a dummy value for each feature in the MIF. Alternatively, checkout gdal trunk from the subversion repo and compile from source (ask a new question if you need help with that). – Luke Jul 1 '13 at 23:59
Great. Thanks Luke. I'll give that a go ASAP and get back to here. – ryanjdillon Jul 4 '13 at 16:15

I am almost certain you can't get away with COLUMN 0. You need at least 1 (dummy) field, but you can skip the MID file and it will create default values for all fields. At least, that is how MapInfo works.

share|improve this answer
You mean I should just make it Columns 1 rather than Columns 0? Thanks. – ryanjdillon Jul 5 '13 at 17:32
Yes, COLUMNS 1 and "Dummy CHAR(1)" on the next line. – Uffe Kousgaard Jul 6 '13 at 10:39
Tried changing COLUMNS 0 to COLUMNS 1 and adding Dummy CHAR(1) in a new line below it, and I am still getting the error. I also tried "Dummy CHAR(1)", just to be sure that wasn't want you meant. – ryanjdillon Jul 9 '13 at 11:57
ogr2ogr may need the MID file (MapInfo doesn't). So, try to create the MID file too with dummy values. – Uffe Kousgaard Jul 12 '13 at 22:31
COORDSYS Earth PROJECTION 1, 104 – Uffe Kousgaard Jul 14 '13 at 11:29

Your Answer


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.