A QGIS plugin designed to support the Multiple Indicator Cluster Survey (MICS) geospatial data anonymisation and extraction of geospatial covariates. Although designed for MICS, the Plugin can be used for any household survey.
- 📖 User Guide - Usage instructions
- 🔧 Developer Documentation - Technical implementation details
- 📝 Release Notes - Version history and changes
- 🐛 Report Issues - Bug reports and feature requests
The MICS Geocode Plugin streamlines the processing of GIS data for MICS surveys. Following documented methodolgy (https://mics.unicef.org/publications/mics-methodological-paper-no-12-2024-geographic-displacement-procedures-and AND https://mics.unicef.org/publications/mics-methodological-paper-no-13-2025-geospatial-covariates-extraction-procedures), it automates three key tasks:
- 📍 Centroid Generation - Generate cluster centroids from GPS coordinates in shapefiles or CSV files
- 🔒 Privacy Protection - Apply random displacement to ensure respondent anonymity
- 🌍 Covariate Extraction - Extract geospatial covariates from raster and vector datasets for further analysis
- Flexible Input: Accepts CSV (with lat/lon) or shapefile formats
- Automated Processing: Streamlined workflow with minimal manual intervention
- Respondent Protection: Built-in displacement algorithms for data anonymisation
- Covariate Processing: Extract data from multiple raster and vector layers
- Configuration Management: Save and reload project settings
- QGIS Integration: Seamless integration with QGIS processing framework
For more detailed instructions on how to install and use the plugin, go to the MICS website (https://mics.unicef.org/mics-gis#learning_corner):
- Download the latest version of the plugin
- Download the manual on how to install the plugin
- Download the manual on how to use the plugin
The MICS tools are available in the UN languages and can be accessed at https://mics.unicef.org/tools#survey-design
If you want to develop or modify the plugin, see the Developer Documentation below.
- QGIS: Version 3.0+
- Python: 3.6+ (bundled with QGIS)
- Operating System: Windows, macOS, or Linux
- Dependencies: All required packages included with QGIS
The information below is for developers who want to modify or contribute to the plugin.
Authors: Nazim Gashi (UNICEF), Jan Burdziej (UNICEF), Etienne Delclaux (CartONG), Miguel Moreno (CartONG)
Note: MGP is used throughout the codebase as an acronym for MICS Geocode Plugin
The repository is organized as follows:
mics-geocoding/
├── plugin/ # Main plugin code
│ ├── micsgeocode/ # Core processing modules
│ ├── *.py # UI and configuration handlers
│ ├── *.ui # Qt Designer interface files
│ ├── metadata.txt # Plugin metadata
│ └── resources.qrc # Qt resources
├── releases/ # Packaged plugin releases
├── WIN_copy.bat # Windows: Install to QGIS plugins folder
├── WIN_zip.bat # Windows: Create distributable ZIP
├── README.md # This file
├── USER_GUIDE.md # End-user documentation
└── release-notes.md # Version history
- QGIS 3.0+ installed
- Python 3.6+ (bundled with QGIS)
- Qt Designer (optional, for UI modifications)
Three helper scripts are provided for Windows developers:
This script setup locally the qgis plugin. It copies everything at the right place in the qgis plugin directory
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\micsgeocodeplugin
This is made for development phase and personal setup.
The first time the plugin is copied using WIN_copy.bat, it is loaded but not activated. This has to be don in QGIS:
Plugin/Install or manage the extensionthenAllthen search formicsgeocodeFinally, check the checkbox, and it's all set !
This script setup a zip file based on %APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\micsgeocodeplugin.
The zip file is named micsgeocodeplugin.zip, and will be located in the same folder as the WIN_zip.bat.
This is made to share the project with others.
For more information on this, please refer to the official documentation on this topic
This script is based on the very common 7zip. Make sure this lib is installed before running this script.
For more information on this, please refer to the official documentation on qgis plugin development
Here’s the directory structure the plugin:
├───icon_bars.png
├───icon_bg_w.png
├───icon_gis.png
├───icon_nobg.png
├───logo_bg_w.png
├───logo_nobg.png
├───logo_w-unicef.png
├───logo_wo-unicef.png
├───metadata.txt
├───mgp_config_reader.py
├───mgp_config_writer.py
├───mgp.py
├───mgp_mainwindow.ui
├───mgp_main_window.py
├───mgp_version.py
├───resources.py
├───resources.qrc
├───ui_mgp_mainwindow.py
├───WIN_build.bat
├───__init__.py
└───test
init.py = The starting point of the plugin. It has to have the classFactory() method and may have any other initialisation code.
png filesoptions for the logo and the icon used in the pluginmetadata.txtContains general info, version, name and some other metadata used by plugins website and plugin infrastructureresources.qrcThe .xml document created by Qt Designer. Contains relative paths to resources of the forms.resources.pyThe translation of the .qrc file described above to Python.mgp_mainwindow.uiThe GUI created by Qt Designerui_mgp_mainwindow.pyThe translation of the *.ui described above to Pythonmgp.pyThe main working code of the plugin. Contains all the information about the actions of the plugin and the main code.mgp_xxx.pythose are the code base behind the plugin. If some modifications needs to be developped on the plugin, those are the files to focus onWIN_build.bat: This helper scripts do the transciprtion from ui to py file, and qrc to py. It needs to be executed only when modifications have been applied to the qrc or the ui file
The WIN_build.bat launch two commands, pyuic5 and pyrcc5. They have to be installed first:
pip install pyqt5-tools
mgp_version.pycontains the version number of the plugin (also written in metadata.txt)mgp_config_reader.pyread a config file (basic ini file) and initialize the plugin with itmgp_config_writer.pywrite a config file (basic ini file) based on the plugin interfacemgp_main_window.pyThis is the part that handles all the complexity of the plugin interface. The signal/slot connection, etc. This documentation can't be a complete introduction to Qt interface programmation. Basically, this file helps maanging user inputs, testing values, and starts the processes. In order to the run the processes, it triggeres the Step01Manager and CovariatesProcesser contains in the micsgeocode folder
__init__.pymandatory files for this folder to be used as a packageLogger.pyhelper class that handle all the logging part. This trigger a logging inside the QGis Log PannelTransforms.pyhelper class that contains only crs variables. This helps centralize every crs related var in one place.Utils.pythis class manage some generic qgis layer processes, such as names, create/remove, writeReferenceLayer.pyFacade that handle management of reference layerCentroidsLoader.pyThe Centroids Loading part: init, and processCentroidsDisplacer.pyThe Centroids Displacment part: init, and processCovariatesProcesser.pyStep02 algorithm
The code is documented, more precise informations would be found inside the files.