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 new to GIS and QGIS software.

is there a batch convert function to convert shape files to mif/mid files?

I can do this individually but is time consuming? I have seen similar functions on here to other formats but i cannot convert them for my needs. ie create both mif + mid files.

Is there a plugin?

I use windows 8. My output folder is C:\Data\Submit

I am looking for something simple like this; Export several files at the same time in QGIS

share|improve this question
up vote 1 down vote accepted

For a single layer, the recipe to export with Python to MIF/MID is the following (deduced from "Dataset Creation Options" of GDAL MapInfo documentation) :

vLayer = iface.activeLayer()
QgsVectorFileWriter.writeAsVectorFormat(vLayer, 
        '/tmp/' + vLayer.name() + ".mif", "utf-8", 
        vLayer.crs(), 'Mapinfo File', datasourceOptions='FORMAT=MIF')

You can now combine this with step 5 from your link Export several files at the same time in QGIS

share|improve this answer

You can use ogr2ogr from GDAL Utilities to batch convert several shape files to mid/mif. If you use OSGeo4W installer you can easy install GDAL Utilities. A simple script for you to convert all shape to mif/mid in the current directory:

@echo off for %%f in (*.shp) do ( set name=%%~nf ogr2ogr -f "MapInfo File" %name% -dsco FORMAT=MIF %%f )

share|improve this answer

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.