ImageLoader is a QGIS plugin that allows users to click on polygons (e.g., grid tiles) to automatically load and display associated raster images from a local folder. The plugin supports customizable filename patterns using prefixes and suffixes, and provides an interactive interface for selecting the input layer, field, and image directory.
- Click a polygon on the QGIS map canvas to load corresponding raster images based on a specified field value.
- Support for customizable filename patterns with optional prefix and suffix inputs.
- Interactive dialog to select a polygon layer, field containing the raster name/code, and image folder.
- Visual feedback with a temporary red rubber band highlighting the clicked polygon.
- Custom cursor (32x32 pixel
cursor.png) for precise clicking, with fallback to a cross cursor. - Supports common raster formats (
.tif,.tiff,.jp2,.jpeg,.jpg,.png). - Error handling for invalid layers, fields, or folders with user-friendly messages.
If your raster folder contains files like:
ortho_999999.jp2ortho_999998.tiffortho_999997.tif
And your polygon layer has a field tile_code with values 999999, 999998, 999997, you can set:
- Prefix:
ortho_ - Suffix: leave it blank
Then, clicking on a tile will load the matching raster (e.g., ortho_999999.jp2) directly into QGIS.
You can set Prefix or Suffix or both Prefix and Suffix or leave it blank (e.g., ortho_999999_georef.jp2, or 999998_ortho.tiff, or 999997.png).
- Activate the plugin via the toolbar icon or the "Image Loader" menu to open the settings dialog.
- Select a polygon layer containing the grid cells.
- Choose the field that contains the raster name or code.
- Specify the folder containing the raster images and optional filename prefix/suffix.
- Click "Activate" to enable the map tool.
- Click a polygon on the map canvas to load associated raster images, with a temporary red highlight on the selected polygon.
- Press Esc to deactivate the tool.
- Clone or download this repository:
git clone https://github.com/Consortis-Geospatial/ImageLoader.git
- Copy the folder to your QGIS plugin directory:
- Linux:
~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ - Windows:
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\ - macOS:
~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/
- Linux:
- Ensure the
cursor.png(32x32 pixel image) is included in the plugin folder for the custom cursor. - Open QGIS and enable the plugin via Plugins > Manage and Install Plugins.
Coming Soon...
- Developed in Python using PyQt and PyQGIS APIs.
- Uses a custom
QDialogfor configuring layer, field, folder, and filename patterns. - Employs a custom
QgsMapToolbased onQgsMapToolIdentifyFeatureto handle polygon clicks and load rasters. - Temporary red
QgsRubberBandvisualization for 100ms to highlight selected polygons. - Supports raster loading with
QgsRasterLayerand filename pattern matching viaglob. - Includes robust error handling for invalid inputs, missing files, or layer issues.
- Compatible with QGIS 3.0 and later.
- QGIS 3.x: Compatible with QGIS version 3.0 and later (tested with 3.38.3), providing the core GIS functionality and PyQGIS API.
- Python 3: QGIS 3.x includes an embedded Python 3 interpreter (typically version 3.7 or higher).
- PyQt5: Required for GUI components like
QDialog,QComboBox,QLineEdit,QPushButton,QLabel,QFileDialog, andQMessageBox. Bundled with QGIS 3.x installations (version 5.15.10 or similar). - PyQGIS: Provides core QGIS functionality, including
QgsProject,QgsRasterLayer,QgsMapTool,QgsMapToolIdentifyFeature, andQgsRubberBand. Included with QGIS. - PyQt5-sip: A dependency for PyQt5, typically included with QGIS (version 12.13.0 or higher).
- Python Standard Library:
os: For handling file paths and folder operations.glob: For matching raster filenames with user-defined patterns.
- Homepage: https://github.com/Consortis-Geospatial
- Issue Tracker: https://github.com/Consortis-Geospatial/ImageLoader/issues
- Author: Gkaravelis Andreas - Consortis Geospatial
- Email: gkaravelis@consortis.gr
- Repository: https://github.com/Consortis-Geospatial/ImageLoader
This plugin is released under the GPL-3.0 license.
