Creating the application
Our application is going to be a standalone Python program built using PyQt and the PyQGIS library. Taking the Lex application we implemented in Chapter 5, Using QGIS in an External Application, as a starting point, let's see how we can organize the source files for the ForestTrails system. We'll start with the following basic structure:
This is very similar to the structure we used for the Lex application, so most of this should be familiar to you. The main difference is that we're using two subdirectories to hold additional files. Let's take a look at what each of these files and directories will be used for:
constants.py
: This module will hold various constants used throughout the ForestTrails system.data
: This is a directory that we will use to hold our raster basemap as well as the SpatiaLite database that holds our tracks.forestTrails.py
: This is the main program for our application.Makefile
: This file tells the make tool how to compile theresources.qrc
...