Difference between revisions of "Creating a QGIS Plugin"

From CUOSGwiki
Jump to navigationJump to search
Line 26: Line 26:
 
=== Installing QGIS Plugins ===
 
=== Installing QGIS Plugins ===
 
Once QGIS is installed and open, go to the 'Plugins' menu and go install the plugins: '''Plugin Reloader''' and '''Plugin Builder'''.
 
Once QGIS is installed and open, go to the 'Plugins' menu and go install the plugins: '''Plugin Reloader''' and '''Plugin Builder'''.
  +
 
Plugin Builder: A useful plugin that creates all the files and boilerplate code required to get going with a plugin.
 
Plugin Builder: A useful plugin that creates all the files and boilerplate code required to get going with a plugin.
  +
 
Plugin Reloader: A useful plugin that aids in testing and changing plugin code, without having to restart QGIS every time.
 
Plugin Reloader: A useful plugin that aids in testing and changing plugin code, without having to restart QGIS every time.
  +
  +
[[File:MW1.png]]
  +
'''Figure 1:''' QGIS plugins used.
   
 
=== Python Bindings ===
 
=== Python Bindings ===

Revision as of 17:51, 4 December 2019

Disclaimer

This tutorial was created for Microsoft Windows platforms. It assumes a basic knowledge of GIS Environments and Python syntax.

Introduction

This tutorial contains instructions to aid you in the creation of your own QGIS plugins.

Data

As most of this tutorial is software based, the only data required is a shapefile layer for testing purposes at the end. One can find the shapefile used for testing here.

Be sure to keep all the downloaded files together,in the same project folder. Keep the folder pathway/filenames simple and clear.

      •	Ex.C:\Users\Larry\QGIS\Projects

Methods

Software Installation

Installing QGIS

The latest version of QGIS is good for this tutorial, it can either be the standalone QGIS version or OSGeo4W installer (both come equipped with some form of Qt creator). For QGIS installation refer to here.

Installing VS Code

Any kind of coding requires a text editor or IDE. If you have a preference then use it, but in this tutorial we will be doing things in VS Code. See here for installation.

Installing QGIS Plugins

Once QGIS is installed and open, go to the 'Plugins' menu and go install the plugins: Plugin Reloader and Plugin Builder.

Plugin Builder: A useful plugin that creates all the files and boilerplate code required to get going with a plugin.

Plugin Reloader: A useful plugin that aids in testing and changing plugin code, without having to restart QGIS every time.

MW1.png Figure 1: QGIS plugins used.

Python Bindings