Skip to content

Installation

Wolren edited this page Apr 28, 2026 · 5 revisions

Installation & Usage in QGIS

LIRiAP can be installed and used in two ways in QGIS.

Option 1: As Script Folder (Quick Testing)

This method is useful for quick testing and experiments without enabling a full plugin.

Steps

  1. Locate your QGIS scripts folder:

    • Windows: C:\Users\<username>\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\
    • Linux: ~/.local/share/QGIS/QGIS3/profiles/default/processing/scripts/
    • macOS: ~/Library/Application Support/QGIS/QGIS3/profiles/default/processing/scripts/
  2. Copy the algorithm pack:

    • Copy the LIRiAP_pack folder into the scripts folder
  3. Restart QGIS (if already open)

  4. Use the algorithms:

    • Open Processing Toolbox (ProcessingToolbox)
    • Search for "LIRiAP"
    • Algorithms appear under ScriptsLIRiAP

Notes

  • This method doesn't require enabling a plugin
  • Changes to scripts require QGIS restart to take effect
  • Good for testing individual algorithms

Option 2: As Plugin Provider (Recommended)

This is the recommended method for regular use, as it provides better integration with QGIS.

Steps

  1. Locate your QGIS plugins folder:

    • Windows: C:\Users\<username>\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\LIRiAP\
    • Linux: ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/LIRiAP/
    • macOS: ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/LIRiAP/
  2. Copy the plugin files: Create the LIRiAP folder and copy:

    • The LiRiAP_provider/ folder
    • The LIRiAP_pack/ folder

    Your folder structure should look like:

    LIRiAP/
    ├── LiRiAP_provider/
    │   ├── __init__.py
    │   ├── LIRiAP_plugin.py
    │   └── algorithms/
    ├── LIRiAP_pack/
    │   ├── *.py (algorithm and worker files)
    
  3. Enable the plugin:

    • Open QGIS
    • Go to PluginsManage and Install Plugins
    • Find "LIRiAP" in the list
    • Check the box to enable it
  4. Verify installation:

    • Open Processing Toolbox
    • Look for "LIRiAP" group in the algorithm list

Running an Algorithm

  1. Open Processing Toolbox: ProcessingToolbox (or press Ctrl+Alt+T / Cmd+Alt+T)

  2. Find the algorithm:

    • Expand the LIRiAP group, or
    • Search for specific algorithm name in the search box
  3. Configure and run:

    • Double-click an algorithm (e.g., "Approximation Standard")
    • Select your Input layer (polygon layer)
    • Adjust parameters as needed:
      • GRID_COARSE / GRID_FINE: Search resolution (higher = more accurate, slower)
      • ANGLE_STEP: Fallback angle sweep step
      • MAX_RATIO: Maximum aspect ratio (0 = unlimited)
      • ALWAYS_RETURN: Enable best-effort fallback
      • USE_BUFFER: Apply containment margin
    • Click Run
  4. View results:

    • Output layer is created in memory (or saved to file if specified)
    • Output fields include: area, angle, ratio, and algorithm-specific diagnostics

Dependencies

Required

  • NumPy
  • SciPy
  • Shapely

These are typically included with QGIS or can be installed via:

pip install numpy scipy shapely

Optional: Numba (Recommended)

Numba provides JIT compilation that significantly speeds up computations.

Auto-install (in algorithm settings):

  • Check AUTO_INSTALL_NUMBA parameter

Manual install:

pip install numba

Numba is optional but recommended for better performance, especially on larger datasets.


Troubleshooting

Algorithms not appearing in Processing Toolbox

Script folder method:

  • Verify LIRiAP_pack folder is in the correct scripts location
  • Check for Python errors in the log (ViewPanelsLog MessagesPython)

Plugin method:

  • Ensure the plugin is enabled in PluginsManage and Install Plugins
  • Check PluginsPlugin ManagerSettingsShow also experimental plugins
  • Check for errors in PluginsInstall from ZIP is NOT needed for local installation

"Module not found" errors

Ensure all dependencies are installed:

pip install numpy scipy shapely numba

Performance issues

  • Enable AUTO_INSTALL_NUMBA or install Numba manually
  • Reduce GRID_FINE for faster (less accurate) results
  • Use Approximation family for fastest results
  • Use single worker (N_WORKERS=1) for BCRS family

Clone this wiki locally