I have multiple MIF files which I would like to translate to KML format.

ogr2ogr -f "KML" geo-mif geo-kml


Unable to open datasource `geo-kml' with the following drivers.

It seems that ogr2ogr has issues writing KML.

Do I need to install something additional?

Other formats like Mapinfo file works like a charm e.g.: ogr2ogr -f "Mapinfo file" geo-kml geo-mif works perfectly

  • installed expat but no luck so far... – Hugo Koopmans Mar 28 '14 at 10:40

You have your input and output datasets in the wrong order. The (rather unintuitive) ogr2ogr syntax is:

ogr2ogr [options] dst_datasource_name src_datasource_name [layers] 

Use the following instead:

ogr2ogr -f "KML" geo-kml geo-mif

Installing Expat won't be enough - you need to rebuild OGR with expat support.

From http://www.gdal.org/ogr/drv_kml.html:

KML reading is only available if GDAL/OGR is built with the Expat XML Parser, otherwise only KML writing will be supported.

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.