---
title: "QGIS plugin"
canonical: "https://servicedesk.maxgeo.com/space/mxAPI/1642135579/QGIS%20plugin"
format: markdown
---
<span style="color: #ffffff">I</span>

TABLE OF CONTENTS

> Macro (toc)


> ℹ️ DataShed5 version 3.2 or newer is required to use the API and associated applications

# Introduction

> Macro (anchor)

The mxMDS plugin for QGIS allows users who do not have direct access to their DataShed5 back-end database (MDS) to import data into QGIS installations on their desktop computers by accessing an API. Both vector layers and tabular data layers are supported.

This has been developed for maxgeo clients making use of the Hosted (SAAS) and PAAS services where these environments are ringfenced in the interests of data security.

On-premises clients don’t require this plugin as they can connect their QGIS installations directly to their MDS within their own network by making use of the standard QGIS MS SQL Server connections.

# > Macro (anchor)

System Requirements

- The plugin has been developed on QGIS version 3.34.4-Prizren, so is supported on this and higher versions of QGIS.  
*maxgeo recommends that users keep their QGIS installations upgraded to the latest version. *
- [mxAPI Licensing and User Requirements](https://servicedesk.maxgeo.com/space/mxAPI/1797455873/mxAPI+Licensing+and+User+Requirements)
- DataShed5 version 3.2 or newer

# > Macro (anchor)

Installation

The plugin is installed from a zip file provided by at the bottom of this article.

- Save the zip file to your local hard drive or OneDrive.
- Launch QGIS.
- On the top menu bar, select Plugins > Manage and Install Plugins.
- In the Plugins window, select **Install from ZIP** on the left menu tree.
- Click on the 3 dots next to the ZIP file box and navigate to the location where you saved the zip file.
- Select the zip file.
- Click the Install Plugin button.
- You should receive a message in green at the top of the window that the plugin has been installed successfully.

![image](media://32dcc8f6-0f64-40bf-8ff5-1614c605d271)

A new button should be displayed on the Plugins toolbar at the top of your QGIS application.

 

# > Macro (anchor)

Upgrades

When a new version of the plugin is released by maxgeo, please follow this procedure.

- Save the zip file to your local hard drive or OneDrive.
- Launch QGIS.
- On the top menu bar, select Plugins > Manage and Install Plugins.
- In the Plugins window, select **Installed** on the left menu tree.
- Click on the mxMDS text in the list so that it’s highlighted.
- Click on the **Uninstall Plugin** button at the bottom of the window.
- A warning message will appear to confirm the uninstall, click Yes.
- In the Plugins window, select **Install from ZIP** on the left menu tree.
- Click on the 3 dots next to the ZIP file box and navigate to the location where you saved the zip file.
- Select the zip file.
- Click the Install Plugin button.
- You should receive a message in green at the top of the window that the plugin has been installed successfully.

# > Macro (anchor)

Launching the plugin

The plugin can add data layers to an existing QGIS project file or a new blank project.

It works better if the QGIS project file is saved on a local disk rather than a OneDrive location.

- Click on the   mxMDS icon in the plugin toolbar to launch the tool.
- It can also be launched from the Plugins menu on the top menu bar.

Plugins > mxMDS > mxMDS

The API window will open

![image](media://c6a04c9a-0d55-4886-b5a2-75c88a8b0fb0)

# > Macro (anchor)

Creating a vector layer

Note that if you hover your cursor over any of the white boxes on the interface, relevant help text will be displayed.

![image](media://70366df0-3040-430d-9dfd-4cff3cdfbda3)

- **MDS API:** Copy and paste the API URL provided by maxgeo into this box.
- **API Key:** Copy and paste the API Key provided by maxgeo into the second box.
- These 2 steps should only be necessary the first time you use the plugin and after that, the plugin should remember the URL and the key. Note that the key will never be displayed, and you will only ever see the ***** mask.
- **Layer Name:** Type a suitable name as it will appear in the QGIS Layers panel.
- **EPSG Column:** This is used when the source table in the MDS contains data using various different coordinate reference systems (CRS). Type the name of this column exactly as it appears in the MDS. If you leave this box blank, the plugin will assume that the source CRS is WGS84 Geographic (EPSG:4326)
- **East/Long Column:** Type the name of the column containing the Longitude or Easting value.
- **North/Lat Column:** Type the name of the column containing the Latitude or Northing value.
- **EPSG Code:** Type the EPSG code value of the destination CRS in which you want the layer to be created.
- **Save Data to:** Navigate to a folder in which the QGIS objects will be created. It is recommended that you keep the objects in the same folder as the Project file but this is not necessary.
- **SQL Query:** Define a query that will retrieve the data to be used to create the layer. It is strongly recommended that you write this query in SQL Server Management Studio (SSMS) first and ensure that the syntax is correct before copying and pasting the string into this window.
- Click the **Create Layer** button. The layer will be displayed in the QGIS Layers panel and a .gpkg file with the same name will be created in the folder specified in the **Save Data to** box.
- By clicking on the **Download Data** button, the source data can be saved as a .csv file.


Example SQL query to create a collar layer using the Long/Lat coordinates:

```sql
Select DataSet, Hole_ID, Hole_Type, LL_Long, LL_Lat, LL_RL
From tblDHColl
WHERE DataSet = 'BOTSWANA'
```

  


# > Macro (anchor)

Creating a tabular layer

It is also necessary to import MDS tables which do not contain any coordinates columns such as Downhole Survey, Downhole Lithology and Downhole Assays data for use in third party plugins such the Geoscience tool which allows downhole visualization of drilling data.

While the first two datasets are contained in database tables, the assays are contained in a View, but both are supported by the plugin.

- tblDHSurv
- tblDHLithology
- tblVWDHAssays


In this case it is necessary to create the collar layer using Projected coordinates rather than Long/Lat coordinate because downhole visualization plugins need meter-based coordinates rather than degrees.

Example SQL query to create a collar layer using projected coordinates:

```sql
Select DataSet, Hole_ID, Max_Depth, Hole_Type, '32735' as EPSG_Code, ORIG_East, ORIG_North, ORIG_RL
From tblDHColl
WHERE DataSet = 'BOTSWANA'
```

In this case, the ORIG coordinates are in the **UTM WGS84 Zone 35 South** system and the corresponding EPSG code is 32735.

This will create a vector collar layer in the QGIS project.

To then add tabular data, the mxMDS plugin is launched again but much less information is required to create the layers.


![image](media://c602d378-11d1-490e-8de6-4acd178a2777)


Only the first three boxes and Save Data to: and SQL Query boxes are required to be completed for tabular layers.

The process can be repeated to create as many tables as necessary to do the required downhole visualization.

# > Macro (anchor)

API layers and Project File locations

If the QGIS project file is saved to a local hard drive, once it’s re-opened the layer’s data source will not need to be repaired but if the project file is saved to a OneDrive location, QGIS will prompt you to locate the layer’s data source.

This will only happen the first time you re-open the QGIS project after creating a new layer via the API. If you use the Auto-Find option on this QGIS dialogue box, in future, this will not be necessary.


# > Macro (anchor)

Refreshing a layer

The data from which a layer was created via the API plugin is not automatically refreshed once the QGIS project file is re-opened.

- Open the QGIS project file that contains the layers created via the API.
- In the Layers pane of QGIS, select the layer.
- Launch the mxMDS plugin.
- The SQL query definition and other settings that were used to create the layer will be automatically retrieved.
- Click the **Create Layer** button. You will receive an error message.
- Click the **Create Layer** button again. The data is refreshed and any new records added to the MDS source table will be displayed as new points.
- Repeat this process for each API derived layer in the project file.


Note that if any de-surveyed collar or other layers have been created using third party downhole visualization plugins such as Geoscience plugin, they are not automatically refreshed and need to be re-created using the new data.

# Downloads

| **Download** | **Version** | **Release Date** | **Release Notes** |
| --- | --- | --- | --- |
|  | 1.0.0.1 | August 2025 |  |
|  | 1.0.0.0 | May 2025 |  |

# Troubleshooting 

keyring error when running the plugin

- Open QGIS
- Top menu > Plugins > Python Console (opens up the console)
- Type the following into the bottom pane next to the >>> and press Enter
  - import pip
- Type the following in the same location and press Enter
  - pip.main(['install','keyring'])



---

## Release Notes

**Version 1.0.0.1**

- Bug Fix for inconsistent connection issue.