How to use MRR Rasters in QGIS on Windows using GDAL

If you use MapInfo Pro and have the “Advanced” raster visualisation and processing plug-in, then you will be familiar with the MRR raster format. If you produce any rasters in MapInfo, either by gridding point data or by any other processing operation, then MRR will be the default output format. That’s because MRR is a best-in-class container for raster data – whether it is continuous data like elevation or bathymetry, classified data (e.g., land use), imagery (e.g., aerial photography), or multispectral imagery (e.g., Landsat or Sentinel). 

Until late 2020, MRR was not supported outside of the MapInfo ecosystem. To promote and support the use of MRR, MapInfo released a read-only MRR driver for GDAL. You can see the original post by Andrei Veselov in the Precisely Knowledge Communities here

GDAL is an open-source software library that can be used to read and write a large variety of raster formats. It is used by many open-source and commercial software suites including ArcGIS, QGIS, and MapInfo. By utilising this free, read-only MRR driver for GDAL, you can open, visualise and process MRR format rasters in QGIS and applications that use GDAL. 

When you display an MRR in QGIS, QGIS will be able to access the overview pyramid and the statistics that are stored in the MRR file. That means you can render an MRR of any size in QGIS efficiently. MRR’s with Continuous, Classified, Image, and Image Palette fields are supported. However, the GDAL MRR driver does not support all the features of MRR. If you have multiple fields only the first one will be visible, it does not support events, and there may be other limitations that no one is aware of yet. 

The MRR driver has been developed as a plug-in to GDAL. This means that it is built separately from GDAL and needs to be added to the existing GDAL installation. After you install QGIS, you will need to add a few library files into specific directories in the QGIS installation to enable it to access rasters in MRR format. 

To start with, you need to download the library files you need from Precisely. The link in Andrei’s post is broken, but you will find the download here or you can Google “MRR GDAL Precisely”. Unzip the package to a location of your choice. 

Next, find out where QGIS is installed on your Windows computer. If you don’t know where it is, you can type QGIS into the Start box, then for the shortcut that is presented, select the “Open file location” option. Look at the properties of the shortcut and you will see the QGIS installation path. 

In the QGIS installation folder, there will be a folder called “bin”. In the “Bin” folder will be another folder called “gdalplugins”. You will need to copy the appropriate MRR GDAL driver DLL for Windows into the gdalplugins folder and the four MapInfo Raster API DLLs into the “bin” folder. For completeness the driver file is named “gdal_MRR.dll” and the four API files are named “MIRasterAPIRT.dll”, “MIRasterIORT.dll”, ” MIRasterOperationsRT.dll”, and ” MIRasterUtilityRT.dll”. 

Now run QGIS and you ought to be able to Add a Raster Layer and browse to an MRR file and render it. You can verify that the MRR driver is available by opening a command window in the QGIS “bin” folder. (Tip: Navigate to the QGIS “bin” folder in Windows Explorer, then type “cmd” in the location bar and hit return). You can run the “gdalinfo” application to verify that MRR is supported. Either of the following commands ought to return a positive response. 

gdalinfo –formats | find “MapInfo”

gdalinfo –format MRR 

So simple, but… there is always a catch. In this case, it is a big one. 

You must ensure that the GDAL MRR driver DLL you supply has been compiled against the same “Major.Minor.x” version of GDAL that QGIS has been compiled against. 

In my version of QGIS (3.16.1 Hannover), I can see what version of GDAL it has been compiled against by going to the “About” box for QGIS. It reports that it has been “Compiled against GDAL/OGR 3.1.4”. That means I need a driver from MapInfo that has been compiled against GDAL version 3.1.x. You need the Major and Minor versions to match. The Build version number does not matter. 

In the package supplied by MapInfo, they include drivers for GDAL 2.4.x and 3.0.x. Neither of these drivers will work with QGIS 3.16.1. I contacted MapInfo support and acquired a new driver that was compiled against GDAL 3.1.2. This driver works in my version of QGIS. The bottom line is – as the GDAL major and minor versions advance, MapInfo must update their driver so that you can access an MRR GDAL driver that works. At the time of writing (February 2022), GDAL had advanced to version 3.4.1. MapInfo engineers are aware of this issue and plan to release a new driver package soon that will support all recent versions of GDAL. 

ArcGIS on Windows has the same “bin” and “gdalplugins” folder structure, but the gdal DLL has a different naming convention. To find out what version of GDAL ArcGIS is compiled against, use Windows Explorer to examine the properties of the “gdal_e.dll” file in the “bin” folder. The “File version” and “Product name” entries can betray the GDAL version. For example, ArcGIS Pro 2.9.0 appears to use GDAL 3.3.x. Once MapInfo update their driver package, I hope to test MRR access in ArcGIS.