Skip to content

A repo to collect PyQGIS scripts and Processing scripts for different purposes

License

Notifications You must be signed in to change notification settings

gacarrillor/pyqgis_scripts

Repository files navigation

PyQGIS scripts

This is a collection of PyQGIS scripts that I write for different purposes. The following scripts are available (under a GNU GPL v3.0 license):

QGIS v3.x

  • Run custom algorithm from PyQGIS standalone script: run_processing_custom_alg_standalone.py

    Allows you to run a custom Processing algorithm from a PyQGIS standalone script. For that, it calls a custom algorithm provider, which in turn uses the custom Processing algorithm. All of them (3 files) are available in the same folder as the standalone script.

    See https://gis.stackexchange.com/q/408684/4972 for instructions.

  • Iterate vector layer features: iterate_features.py

    Allows you to iterate features of the active vector layer. It selects one feature at a time and pans (for point layers) or zooms to it (for the other geometry types or even geometryless tables).

    See http://gis.stackexchange.com/q/133189/4972 for instructions.

    image

  • Split line in parts of the same length: line_substring_qgis3.py

    Splits the selected line into several parts of the same length. Deletes the original line and copy its attributes to all new parts. It does not save the new lines, allowing you to check before saving yourself.

    Instructions:

    1. Select a line layer in the Layers Panel.
    2. Select a single line in the canvas.
    3. Set the parts variable: Number of parts you want the line to be split into.
    4. Run the script.
  • Extend C++ QGIS Processing Algorithms: extend_c_plus_plus_qgis_alg.py

    The vast majority of C++ QGIS algorithms cannot be subclassed, but we can extend them (think of using their input/output parameters, flags, etc.) adding some custom logic for our own purposes.

QGIS v2.x

About

A repo to collect PyQGIS scripts and Processing scripts for different purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages