Tutorial ILMSImage

From ILMS-Wiki
(Difference between revisions)
Jump to: navigation, search
m (Preliminary Remarks)
m (Preliminary Remarks)
Line 14: Line 14:
 
For a successful application of ILMSImage functions within the interface of [http://www.qgis.org QuantumGIS] the following program components or libraries are required:
 
For a successful application of ILMSImage functions within the interface of [http://www.qgis.org QuantumGIS] the following program components or libraries are required:
 
# an installation of the free desktop GIS-Software '''QuantumGIS''' (from Version 1.5),
 
# an installation of the free desktop GIS-Software '''QuantumGIS''' (from Version 1.5),
# a'''Python'''-Interpreter (recommended version: 2.5.2),
+
# a '''Python'''-Interpreter (recommended version: 2.5.2),
 
# the command line tools of the Geospatial Data Abstraction Library ('''GDAL''', from Version 1.7),
 
# the command line tools of the Geospatial Data Abstraction Library ('''GDAL''', from Version 1.7),
 
# a command line version of '''ILMSImage''' (xILMSImage, recommended version: 2010-11-08),
 
# a command line version of '''ILMSImage''' (xILMSImage, recommended version: 2010-11-08),

Revision as of 12:15, 12 September 2011

Contents

ILMSImage Plug-in for QuantumGIS

Introduction

The below described plug-in makes functions of the image analysis software ILMSImage available in the context of the user interface of QuantumGIS. ILMSImage has been developed to process extensive amounts of image data of remote sensing in an effective and purposeful way and to be able to thematically analyze the data. The program relies on the concept of object-oriented image analysis, i.e. image elements (pixels) of a data set are not treated separately but in the context of neighboring elements which are spectrally similar. This concept manifests itself in the typical ILMSImage process chain which usually consists of three steps:

  1. First, an analysis of separate pixels is carried out on the basis of spectral similarity and spatial proximity. This results in a summary of adjacent image elements to bigger groups with similar spectral characteristics. This process is often called segmentation in the context of object-oriented image analysis and cell creation in the context of ILMSImage.
  2. In a second step, the derivation of cell-based attributes or features. These attributes can be generated from the geometry of the grid cells of the first step or from their link to the original image data or additional data sources. Further processing is carried out on the basis of generated cells and the derived attributes; the original data are not taken into account in the remaining course of processing.
  3. The third step comprises the actual thematic classification. ILMSImage is based on a two-step concept which links an unsupervised classification of cells and their attributes to an supervised classification according to reference data. According to the classification schema which has been provided by the user the designation of thematic areas within the study area is carried out.

Installation

Preliminary Remarks

For a successful application of ILMSImage functions within the interface of QuantumGIS the following program components or libraries are required:

  1. an installation of the free desktop GIS-Software QuantumGIS (from Version 1.5),
  2. a Python-Interpreter (recommended version: 2.5.2),
  3. the command line tools of the Geospatial Data Abstraction Library (GDAL, from Version 1.7),
  4. a command line version of ILMSImage (xILMSImage, recommended version: 2010-11-08),
  5. the Python source code of the QuantumGIS GUI plug-ins.

The project OSGeo4W of the Open Source Geospatial Foundation (OSGeo) makes available a comprehensive set of source-open programs and libraries used for editing spatial data which can be used for a simple installation and potential update of the first three components. Therefore, in this instruction an installation using this package is described - although a separate installation of QuantumGIS, Python and GDAL is basically possible. The two last components are available in the context of research cooperations at the Chair of Geoinformatics of the Friedrich-Schiller-University Jena.

Preparations and Requirements

The download of the OSGeo4W Installation package is carried out from the website of the project. At irregular intervals, the package is updated which is usually not announced on the website. In order to stay updated it is recommended download the package again from time to time.

For an installation of the plug-in about 200 to 300 megabytes are required on the hard disk. Moreover, disk space for the (image) data to be processed and the corresponding intermediate and end products is needed.

Description of the Installation

The installation of the plug-in is carried out according to the following order::

  1. Installation and set-up of QuantumGIS, Python and GDAL using the OSGeo4W package
  2. Installation and activation of the GUI plug-ins
  3. Installation of the ILMSImage command line version
  4. Final installation of the GUI plug-in

Installation and Set-up of QuantumGIS, Python und GDAL

For the installation and set-up of the components QuantumGIS, Python and GDAL you can use the downloaded OSGeo4W package. This is based on the installation software for the Cygwin project, i.e. the programs available are displayed in a tree structure. If one of the program packages is selected for the installation, there follows an automatic selection of those packages which are mandatory for its execution. In this way it is possible to keep control of possible dependencies between various programs or libraries.

The installation is described step by step.

After double-clicking on the executable file, the start window of the installation package appears. In this example, Advanced Installation is chosen.

Bild:ilms_img_qgis_install_01.png


When an Internet connection is already available, the corresponding option can be chosen as download source:

Bild:ilms_img_qgis_install_02.png


In the next window a directory for the installation is chosen. It is highly recommended to use the suggested option (default C:\OSGeo4W) since a relocation of the installation requires high effort for an adaptation. By choosing the option All Users all users of the Windows installation gain access to the shortcuts to the installed programs:

Bild:ilms_img_qgis_install_03.png


After selecting an installation directory, a directory for the package is chosen. This is a folder which serves as a backup folder for the program packages which will be downloaded and which have not yet been installed. In order to allow for an execution later on these packages are not needed, i.e. they can be stored on an external hard disk or in a network folder. It should be noted that the package directory allows a re-installation of the entire system without being connected to the Internet. In order to do this, the option Install from local directory is selected when choosing the data source during a re-execution of the installation package, then the corresponding path is selected:


Bild:ilms_img_qgis_install_04.png


Subsequently, an Internet connection type can be selected (no image). After downloading the entire list of packages from the server of the OSGeo initiative, the above-mentioned tree view of all installable programs and libraries appears. Those are distributed among the categories Commandline Utilities, Desktop, Libs, Web and Web Applications. In order to install the current version of QuantumGIS it is sufficient to locate the corresponding program package in the category Desktop and selecting it for the installation by clicking on the symbol with two arrows. The successful selection can be verified with a version number which should be found after clicking on the former position of Skip. The convenience of the OSGeo4W installation package is that all additional programs and libraries which are necessary for executing the installed software are noted for later installation when choosing the program package for QuantumGIS. In the presented case this also includes the Python interpreter and the GDAL command line tool. By clicking on Next the download and installation of all selected program packages is initiated. This can take quite some time - depending on the size and number of the selected packages and connection speed.

Bild:ilms_img_qgis_install_05.png


After completing the installation, it is possible to install a desktop icon and a shortcut in the Start Menu to have a quick access to the installed software (no image). As a result of this first step in the installation a shortcut to the QuantumGIS version which has been installed appears which can be used to launch the program immediately:

Bild:ilms_img_qgis_install_06.png

Installation and Activation of the GUI Plug-in

QuantumGIS allows the generation and integration of plug-ins via a program interface. Those plug-ins make GIS and other functions available in an adjusted manner. Plug-ins can be implemented into C++ or Python - the ILMSImage plug-in is written in the latter language - and they are generated using Qt or PyQt, two cross-platform class libraries for programming graphical user interfaces.

In order to allow the user of QuantumGIS the use of the ILMSImage Plug-in, the directory with the source code data has to be copied into the folder structure of the GIS software. Provided that the installation folder which is suggested in the set-up package has not been changed, the destination of this integration is the following directory: C:\OSGeo4W\apps\qgis\python\plugins

After copying, the antecedent directory should have a sub-directory called ILMSRaster which contains all source code data. Special attention should be paid to the correct spelling (also: use of capital and small initial letters) of the name because it is internally accessed.

This installation procedure is followed by the activation of the plug-in using the QuantumGIS interface. For this purpose the sub-item Manage Extensions under the menu item Extensions appears after launching the program:

Bild: ilms_img_qgis_install_07.png


The window of the appearing QuantumGIS extension manager contains a set of plug-ins which are available and the source code of which - in case of their implementation in Python - is also already in the described directory. The entry called ILMSRaster/ILMSImage plug-in for QuantumGIS is the ILMSImage plug-in:

Bild: ilms_img_qgis_install_08.png


After the activation of the checkbox and closing the extension manager the ILMSImage plug-in is available under the menu item Extensions and the corresponding toolbar for further use:

Bild: ilms_img_qgis_install_09.png


By clicking on the menu item ILMSRaster or the icon in the toolbar the plug-in appears in the context of a panel linked to the desktop on the right side of the QuantumGIS user interface:

Bild: ilms_img_qgis_install_10.png

Installation of the ILMSImage Command Line Version

The command line version of ILMSImage is a specially generated executable version of the program which allows to control and execute the functions of the software via a command line interpreter. The interaction with the user is ensured by outputs in the command line or in the context of integrating the program into an external application, as is the case for the plug-in for QuantumGIS. The command line version of ILMSImage is usually called xILMSImage in order to set it apart from the existing version of the program with user interface.

In order to address ILMSImage with the existing plug-in, the executable file of the command line version should be on the computer which also contains QuantumGIS and the corresponding extension. Moreover, the installation file of the plug-in has to be modified. This file has the name ilmsraster.cfg and can be found in the root directory of the plug-in, according to the above-described installation it is in directory C:\OSGeo4W\apps\qgis\python\plugins\ILMSRaster.

The file is a text file which contains the most important information on the plug-in and the latest project which has been worked on. It is divided into different sections which all summarize various configuration entries. The section ilmsimage contains all information on the actual plug-in. The entry ilms_img_bin should be followed by the path of the command line version of ILMSImage; then the plug-in has the corresponding functions available:

ilms_img_bin = C:\ilms_img\bin\xILMSImage.exe

In this example, the command line version is in the directory c:\ilms_img\bin and is called xILMSImage.exe.

Final Installation of the GUI Plug-in

In order to finish the installation of the ILMSImage plug-in it is necessary to integrate the installation file of the GDAL command line tool into the plug-in. This can be done using the above-mentioned configuration file ilmsraster.cfg. In section ilmsimage you will find an entry named gdal_bin_dir. It is followed by an indication of the corresponding directories. If the installation has been completed as described the following entry should serve the desired purpose:

gdal_bin_dir = C:\OSGeo4W\bin

It should be noted that it is usually necessary to restart QuantumGIS after changing the configuration file in order to make it operative.

After completing the installation as described there should be no problem to execute the ILMSImage plug-in.

Updating a Current Installation

An existing installation of the ILMSImage plug-in can be up-to-date by updating individual program components.

  1. The source code of the plug-in can be updated by overriding the existing version by a new one.
  2. In case the command line version has to be updated, the path to a new file has to be written in the configuration file ilmsraster.cfg under ilms_img_bin.
  3. QuantumGIS, GDAL andPython can be updated by re-processing the OSGeo4W installation package. The procedure starts as described above. Then the setup program - after obtaining a new package list via Internet - autonomously identifies the components of an existing installation which should be updated. In order to control which changes are made, the view on the package window can be modified by repeatedly clicking on Ansicht/View. If the key word Teilw. appears next to the corresponding button, all packages are listed which are being updated and which are to be installed or deleted. It is recommended to carry out the update at least always when a modified plug-on source code is supposed to be used.

602px|Die Liste der zu aktualisierenden Pakete einer OSGeo4W-Installation

Application

Preliminary Remarks

To illustrate the application of the ILMSImage plug-in an example application is shown which examines the catchment area of the Rot in Thuringia. All necessary input data are available to download, so you can understand the example more easily. In this instruction the corresponding file was unpacked into a new directory called C:\ilms_img. To launch the example application, you only have to load the prepared QuantumGIS project C:\ilms_img\rot.qgs under the menu item Open Project File... from the menu File.

Bild: ilms_img_qgis_work_01_de.png

After opening the project you will see the interface of QuantumGIS as shown in the following image. The main part is filled by the mapping of the data. The overview of layers on the left side shows the elements which have been loaded, image data (Imagery), the borders of the catchment area (Catchment) and the reference data (Training Data) which are necessary later on and not yet shown in the map.

Bild: ilms_img_qgis_work_02_de.png

Implementing an Example Application

Activation of the ILMSImage Plug-in

The plug-in is activated as described above by selecting the corresponding item in the menu Extensions or by using the corresponding symbol in the toolbar. Then the GUI Panel appears on the right side of the workspace which makes all possible functions available. In order to process a project the plug-in comprises four sub-panels which can be selected by using the corresponding titles. You have the following functions at disposal:

  1. ILMSImage Setup helps you to select appropriate input layers and allows a later selection of a partial test area and creates a new ILMSImage project.
  2. ILMSImage Cell Creation carries out cell formation using the the selected input data and optional parameters.
  3. ILMSImage Attribute Calculation calculates cell-based attributes and features and allows the integration of additional data levels.
  4. ILMSImage Classification carries out a two-step thematic evaluation, consisting of unsupervised and supervised classification.

Below, the individual sub-panels are described in detail with the help of an example process chain for the test area of the Rot river.

50px| ILMSImage Setup

ILMSImage Setup is used for choosing suitable input data layers allows a subsequent selection of a partial test area and generates an IMLSImage project.

A detailed description is provided in the main article on ILMSImage Setup

50px| ILMSImage Cell Creation

ILMSImage Cell Creation leads to cell creation according to selected input data and additional optional parameters.

A detailed description is provided in the main article on ILMSImage Cell Creation

50px| ILMSImage Attribute Calculation

ILMSImage Attribute Calculation calculates cell-based attributes and features and allows the integration of additional data layers.

A detailed description is provided in the main article on ILMSImage Attribute Calculation

50px| ILMSImage Classification

ILMSImage Classification carries out a two-step thematic analysis, consisting of unsupervised and supervised classification.

A detailed description is provided in the main article on ILMSImage Classification

Personal tools