In this article we will be discussing about convert GeoJSON to MIF Mapinfo using GDAL utility (Ogr2ogr). This conversion is useful with MapInfo mapping and geographic analysis softwares.
Convert Geojson to MIF MapInfo file
We must understand GeoJSON and MIF format in detail before conversion.
Specification of GeoJSON data- Convert Geojson to MIF
Geojson data is open standard format, contains simple geographical feature with non-spatial data. In type, it has feature collection. That contains name, CRS (coordinate reference system) and features. These features can be line, point, polygon, Multi-Line string and multi-polygon. Properties contains all attribute information.
Specification of MIF data- Convert Geojson to MIF
MIF (Map Info File) File format used by MapInfo mapping and geographic analysis software. This stores a map visualization in a format that can be recognized by third party applications. Also used as an exchange format between GIS applications. This sometimes accompanied by a .MID (MapInfo data) file that contains additional spatial data. MID files are GIS data files created by MapInfo, a spatial data analysis and visualization software, saves spatial data for a corresponding .mif (MapInfo Interchange Format) file. Also used for storing larger data sets not expressed in the MIF file.
MIF file show some general property when open with QGIS software, as like :
i.) Storage type of this layer
–> MapInfo File
ii.) Description of this provider
–> OGR data provider (compiled against GDAL/OGR library version 2.2.2, running against GDAL/OGR library version 2.2.2)
iii.) Source for this layer
iv.) Geometry type of the features in this layer
v.) The number of features in this layer
vi.) Capabilities of this layer
–> Fast Access to Features at ID, Presimplify Geometries, Presimplify Geometries with Validity Check
vii.) In layer spatial reference system units
–> xMin,yMin 68.4982,7.92528 : xMax,yMax 97.3348,35.5013
viii.) Layer Spatial Reference System
–> +proj=longlat +datum=WGS84 +no_defs
Convert GeoJSON to MIF using GDAL utility-
Gdal library should be available in system when converting data format from one to another. This utility can be installed in system by following the given commands.
The options available with ogr2ogr utility cab seen by typing ogr2ogr in command prompt.
The drivers or format supported by utility can be seen by typing the following command.
–> ogr2ogr –formats
Convert the Geojson data in MIF with given command.
–> ogr2ogr -f ‘MapInfo File’ -a_srs EPSG:4326 MIF_output.mif geojson_input.geojson
The option -a_srs is used to assign coordinate system to generated output file.
Output in QGIS software- Convert Geojson to MIF
The generated output file can be open with QGIS open source software.
You can also use conversions using gdal utility as netcdf to geotiff, Hdf to geotiff, shapefile to topojson and many more.
Please comment in the given comment box for any help and suggestions. We are always ready for your help.