GeoPublicHealth

A QGIS Plugin for Epidemiology and Public Health GIS Analysis
📚 Table of Contents
✨ Overview
GeoPublicHealth provides a simplified interface within QGIS, tailored for users in epidemiology and public health. It builds upon the foundation laid by the GeoHealth Plugin (developed by Etienne Trimaille) and incorporates additional methods highly relevant for applying GIS in public health research and practice.
This plugin aims to integrate and enhance methods similar to those found in the pioneering SIGEpi software, leveraging the power and flexibility of the modern QGIS platform.
Key analysis tools include:
- Spatial autocorrelation: Moran (local/global), Moran rate, bivariate Moran, Join Counts, Local Geary, Getis-Ord G
- Incidence and density mapping workflows
- Composite index building and data blurring utilities
- Autocorrelation UI with dynamic help text and summary output panel
✅ Prerequisites
Before installing the GeoPublicHealth plugin, you need:
- QGIS: Version 3.42.x or newer is required. Tested with:
- Python Dependencies: The plugin relies on specific Python libraries that must be correctly installed within your QGIS environment:
gdal (usually included with QGIS/OSGeo4W, version ~3.10.2 or newer) - Required
libpysal (version ~4.3.0) - Required
numba (latest compatible version) - Required
matplotlib (latest compatible version) - Optional (enables graphing/plotting features)
Note: The installation methods below are designed to help ensure these dependencies are met. See DEPENDENCIES.md for detailed dependency information.
🚀 Quick Start
- Install QGIS 3.42+ for your platform.
- Run
install_dependencies_console.py from the QGIS Python Console.
- Restart QGIS.
- Open Plugins → GeoPublicHealth.
Latest Version: v0.3.1 (2026-01-28) - Installation stability and processing tests
🧭 Installation
Installation has two steps: install QGIS, then run the dependency installer script.
Step 1: Install QGIS
* macOS users should use QGIS 3.44, which is stable and recommended for macOS.
🪟 Windows (OSGeo4W recommended)
- Download and run the OSGeo4W installer.
- Choose Advanced Install → Install from Internet.
- Select packages:
qgis (Desktop)
gdal (Libs)
python3-libpysal (Libs)
- Complete installation and launch QGIS once.
Video walkthrough: OSGeo4W install.
🍎 macOS
- Install QGIS from the macOS installer.
- Open QGIS once (right‑click → Open on first run).
- Use the QGIS Python Console for dependencies (do not use system Python).
For the full macOS walkthrough and advanced troubleshooting, see:
🐧 Linux
Install QGIS from your distro packages and ensure python3-gdal, python3-libpysal (or python3-pysal), and python3-numba are available to QGIS.
Step 2: Run the Dependency Installer Script
Run the same script on all platforms:
- Download
install_dependencies_console.py from the repo or direct link.
- Open Plugins → Python Console.
- Click Show Editor → Open Script → select
install_dependencies_console.py.
- Click Run Script and watch progress messages.
- Restart QGIS.
The script will:
- Enable experimental plugins.
- Add the GeoPublicHealth repository.
- Reload repositories from the network.
- Install required dependencies (
libpysal, esda, numba).
- Install the GeoPublicHealth plugin.
Logs are written to ~/GeoPublicHealth/ (Windows: %TEMP%).
Step 3: Install the Plugin (Fallback Only)
Use these steps only if the script did not install the plugin after restart.
Option A: Repository
- Open Plugins → Manage and Install Plugins… → Settings.
- Enable Show also experimental plugins.
- Add repository:
- Name:
GeoPublicHealth
- URL:
https://raw.githubusercontent.com/ePublicHealth/GeoPublicHealth/main/docs/plugins.xml
- Search for
geopublichealth and install.
Option B: ZIP
- Download the latest release from GitHub Releases.
- Plugins → Install from ZIP → select
geopublichealth.zip.
🧪 Verification
After restarting QGIS, run this in the Python Console:
import libpysal, esda, numba
print(f"✓ libpysal {libpysal.__version__}, esda {esda.__version__}, numba {numba.__version__}")
🎨 Optional: Matplotlib
Matplotlib enables plots in analysis dialogs. You can also re-run install_dependencies_console.py, which installs it automatically.
Run the snippet below as a script in the QGIS Python Editor (Show Editor → Run Script):
import subprocess
from pathlib import Path
from qgis.core import QgsApplication
prefix = Path(QgsApplication.prefixPath())
candidates = [
prefix / "Contents" / "MacOS" / "python3.12",
prefix / "Contents" / "MacOS" / "bin" / "python3",
prefix / "Contents" / "bin" / "python3",
]
python_exec = next((p for p in candidates if p.exists()), None)
if not python_exec:
raise FileNotFoundError(f"No QGIS Python found in: {prefix}")
subprocess.run([str(python_exec), "-m", "pip", "install", "matplotlib"])
Restart QGIS after installation. See DEPENDENCIES.md and UNINSTALL_INSTRUCTIONS.md for advanced scenarios and cleanup.
🛠️ Troubleshooting
🧩 Plugin Not Appearing After Installation
If the plugin doesn’t appear after installation:
- Restart QGIS first:
- Settings changes (experimental plugins, repositories) require a full QGIS restart
- After running
install_dependencies_console.py, always restart QGIS completely
- Check experimental plugins are enabled:
- Go to Plugins → Manage and Install Plugins → Settings
- Ensure [x] Show also experimental plugins is checked
- Clear cache and reinstall:
# macOS
rm -rf ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins/geopublichealth
rm -rf ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/cache
# Linux
rm -rf ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geopublichealth
rm -rf ~/.local/share/QGIS/QGIS3/profiles/default/cache
# Windows
rmdir /s /q "%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\geopublichealth"
rmdir /s /q "%APPDATA%\QGIS\QGIS3\profiles\default\cache"
- Restart QGIS and reinstall the plugin
🧪 ModuleNotFoundError
If you see errors about missing modules:
🧰 Python Console Installation Issues
Important: When using the QGIS Python Console:
- Run commands one line at a time (press Enter after each line)
- Do NOT paste multiple lines at once - this will cause
SyntaxError: multiple statements found
- Wait for each command to complete before running the next one
- If installation fails with build errors, use the
--no-build-isolation flag:
import subprocess, sys
subprocess.run([sys.executable, "-m", "pip", "install", "libpysal", "esda", "--no-build-isolation"])
📌 Other Issues
🧭 Usage
Once installed, the GeoPublicHealth plugin tools and algorithms can typically be accessed via:
- The Plugins Menu -> GeoPublicHealth.
- A dedicated GeoPublicHealth Toolbar (check View Menu -> Toolbars).
- The QGIS Processing Toolbox (under Plugins or GeoPublicHealth).
Refer to specific documentation or tutorials for detailed workflows using the plugin’s features.
👩💻 Development
🧑💻 For Developers
See AGENTS.md for development guidelines and coding standards.
See RELEASE.md for information on the release process.
✅ Running Tests
# Run all tests (QGIS Python environment required)
python test_suite.py
# Run a single test
python -m unittest src.test.test_pep8.TestPep8.test_pep8
# Run processing algorithm tests
make processing-test
# Run PEP8 style check
make pep8
For macOS, make processing-test uses QGIS bundled Python automatically
(default path: /Applications/QGIS.app).
If QGIS is installed elsewhere, override paths:
QGIS_APP="/path/to/QGIS.app" make processing-test
# or
QGIS_PYTHON="/path/to/QGIS.app/Contents/MacOS/python3.12" make processing-test
Building the Plugin
The plugin is automatically built and released using GitHub Actions. To manually build:
# See RELEASE.md for detailed build instructions
🤝 Contributing
Contributions are welcome! Please review the Contribution Guidelines before starting.
- Fork the repository on GitHub.
- Create your feature branch:
git checkout -b my-new-feature
- Make your changes following the code style guidelines
- Run tests:
python test_suite.py, make processing-test, and make pep8
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Open a Pull Request
🐛 Reporting Issues
Found a bug? Please help us fix it by submitting a detailed issue report.
Before Submitting A Bug Report
- Search existing issues: Check if the problem has already been reported: GeoPublicHealth Issues
- If you find a similar issue, add comments there instead of creating a new one.
How to Submit a Good Bug Report
Create an issue on the repository issues page and provide as much detail as possible:
- Clear Title: Use a descriptive title summarizing the problem.
- Steps to Reproduce: Provide exact steps to reliably reproduce the bug. Include sample data or simplified examples if possible.
- Observed Behavior: Describe what actually happened after following the steps.
- Expected Behavior: Explain what you expected to happen instead.
- Screenshots/GIFs: Visual aids are extremely helpful. Use tools like LiceCap, Peek, or similar to record GIFs if possible.
- Crash Reports/Logs: If QGIS or the plugin crashed, include the relevant error messages or log output from the QGIS Log Messages Panel (View -> Panels -> Log Messages). Paste logs inside Markdown code blocks or link to a Gist.
- Context:
- Can you consistently reproduce the problem?
- When did it start happening (e.g., after an update)?
- Does it happen with specific data, projects, or file types?
- Your Environment:
- QGIS Version (e.g.,
QGIS 3.42.2-Münster)
- Operating System (e.g.,
Windows 11, macOS Sonoma 14.4, Ubuntu 22.04)
- GeoPublicHealth Plugin Version
🙏 Credits and Authorship
GeoPublicHealth Plugin:
Based on the original GeoHealth Plugin:
- Original Author: Etienne Trimaille
- Original Design: UMR Espace-DEV (IRD, UAG, UM2, UR)
🗓️ Changelog
v0.3.0 (2026-01-25)
- Remove unintended transparency on LISA Moran’s I layer
- Reload plugin repositories and auto-install GeoPublicHealth in installer
- Add clearer progress feedback during dependency installation
v0.2.24 (2026-01-25)
- Critical Fix: Incidence dialog field comboboxes now populate correctly
- Fixed Case field and Population field combobox initialization
- Automated plugin repository configuration in dependency installer
- Dependency installer now automatically enables experimental plugins
- Improved user experience with clear restart instructions
v0.2.22 (2026-01-23)
- Autocorrelation UI summary panel and updated layout
- Tooltips for statistic, fields, and join counts inputs
v0.2.21 (2026-01-23)
- Added significance flags and symbology for global stats
v0.2.20 (2026-01-23)
- Join counts auto-detect for binary fields
v0.2.19 (2026-01-23)
- Join counts global/local statistics with thresholding
v0.2.18 (2026-01-23)
- Moran global and bivariate statistics
- Dynamic help panel updates based on statistic
v0.2.17–0.2.3 (2026-01-22 to 2026-01-23)
- GeoPackage autocorrelation fixes and CRS handling
- macOS file dialog fallbacks and output path validation
- Output geometry recovery and exception handling fixes
v0.2.2 (2026-01-22)
- Critical Bug Fixes:
- Fixed spatial autocorrelation for GeoPackage layers
- Fixed GeoPandas layer reading with
|layername= parameter
- Removed unsupported context manager in legacy PySAL code
- Fixed “No such file or directory” error when reading GeoPackage
- Fixed UI validation warnings when no layers loaded
- Installation & Dependencies:
- Updated macOS installation instructions with working commands
- Fixed dependency installation with
--no-build-isolation flag
- Added step-by-step libpysal, esda, and matplotlib installation
- Documented one-line-at-a-time Python Console requirement
- Improvements:
- Full GeoPackage and Shapefile format support
- Better error messages for format compatibility
- Enhanced documentation with verified installation methods
v0.2.1 (2026-01-22)
- Critical Fixes:
- Fixed plugins.xml configuration for proper QGIS plugin repository integration
- Fixed module import paths (GeoPublicHealth → geopublichealth) throughout codebase
- Fixed plugin directory name mismatch issue
- Fixed display_message_bar API compatibility with QGIS 3.x
- Made matplotlib dependency optional - plugin now loads without it
- Improvements:
- Added optional_deps.py module for graceful handling of optional dependencies
- Graphing features now disable gracefully when matplotlib unavailable
- Updated all 89 import statements for correct module paths
- Documentation:
- Added DEPENDENCIES.md with complete dependency information
- Added UNINSTALL_INSTRUCTIONS.md for troubleshooting installation issues
- Added install_matplotlib_in_qgis.py script for easy matplotlib installation
- Updated README with troubleshooting section
- Bug Fixes:
- Fixed f-string syntax error in autocorrelation dialog that prevented plugin loading on macOS
- Fixed TypeError when displaying message bar warnings
- Development:
- Added AGENTS.md for AI coding agent guidance
- Added RELEASE.md for release process documentation
- Set up GitHub Actions for automated testing and releases
- Fixed indentation errors in test files
v0.2.0 (2025-05-01)
- QGIS 3.42 support and autocorrelation improvements
- Updated dependencies and compatibility
See all releases for complete version history.
📖 Documentation
🧭 Installation Guides
Installation Scripts:
👩💻 Development
💬 Support
- Issues: GitHub Issues
- Discussions: Use GitHub Issues for questions and discussions
- Email: manuel.vidaurre@gmail.com
📄 License
This project is licensed under the terms specified in the LICENSE file.
Copyright (c) 2017-2026 The GeoPublicHealth Contributors and Original Authors.