Installation Guide

## Install from package

###### Use of plugin manager
A package containing all the needed dependencies can be installed through QGIS Plugin Manager. To install from plugin manager:
1. Click the menu "Plugins" -> "Manage and Install Plugins".
2. Enter 'Open Aerial Map' in search box.

Note: Make sure that "Show also experimental plugins" is checked at the Settings tab, otherwise the OAM plugin will not be shown among the available ones.

###### Download from plugin repository
Alternatively, you can directly download from  [repository](https://plugins.qgis.org/plugins/OpenAerialMap/).
To install:
1. Unpack the dowloaded file 'OpenAerialMap-xxxx.zip'.
2. Place the extracted files/folder in QGIS plugins directory.
3. Activate the plugin through QGIS menu ("Plugins" -> "Manage and Install Plugins").
4. You can see the OAM icons at the QGIS action bar, if plugin is activated.

## Build from source code

###### Dependencies:
* [Sphinx](http://www.sphinx-doc.org/en/stable/install.html) - To create help file,
Sphinx documentation generator is being used in this plugin. To install Sphinx,
please refer to the OS specific instructions at the website. (NOTE: As of July 2016,
document generation is supported only in Linux environment. Threfore, users of
other operating systems can ignore the dependency of Sphinx.)
* [Python](https://www.python.org/) - Installation of Sphinx requires python. If
your operating system doesn't have python installed, please refer to the instruction
at the website. Version 2.7 is presently being used for this plugin development.
* pyrcc4 - To compile Qt4 resource files into python code, pyrcc4 command must
be used. Please refer to the OS specific instructions below for its installation
or setting path.

###### Linux
1. Install pyrcc4:
The easiest way to install pyrcc4 is probably to use package manager.
If using ubuntu 14.04 or its comatible distributions, following command should work:
    apt-get install pyqt4-dev-tools
sFor the other distributions, please use the online resourece to get the information.

2. Download the repository and deploy the code to the plugin directory:
$ git clone https://github.com/hotosm/oam-qgis-plugin.git
$ cd oam-qgis-plugin/OpenAerialMap/
$ make deploy

###### Windows
1. Set the path to pyrcc4.exe:
To execute the make.bat file in MS-Windows, you need to set the path to pyrcc4.exe.
Probably, the easiest way to set the path is to use OSGeo4W Shell. (If you open
the shell, the path to the file should be automatically set.) However, you can also
manually set the path from normal command prompt.

  1. Find the pyrcc4.exe file in the QGIS folder:
  Ex. For the version 2.14.4 (Essen), C:\Program Files\QGIS 2.14.4\bin\ or
  C:\Program Files\QGIS Essen\bin\

  2. Set the path, using set command:
  Ex. For the example above, execute SET PATH=%PATH%;C:\Program Files\QGIS 2.14.4\bin
  or C:\Program Files\QGIS Essen\bin

2. Download the repository and deploy the code to the plugin directory:
$ git clone https://github.com/hotosm/oam-qgis-plugin.git
$ cd oam-qgis-plugin\OpenAerialMap\windows\
$ make.bat deploy

## Activate or reload deployed plugin

You can activate the deployed plugin through QGIS menu "Plugins" -> "Manage and
Install Plugins". You should see OAM icons in your menu at this point.

After any change in the code you need to run 'make deploy' again. You also need
to restart QGIS to reload the new compiled code. A handy alternative is to use
the "Plugin Reloader" plugin to reload and live test your changes on the code.
If necessary, you can also use 'make derase' command to erase the deployed folder
completely.
