TransWikia.com

ogr2ogr MIF to KML fails on writing kml in linux

Geographic Information Systems Asked by Hugo Koopmans on January 15, 2021

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

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

FAILURE:

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

2 Answers

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

Correct answer by user2856 on January 15, 2021

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.

Answered by BradHards on January 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP