Chapter 1. Introduction

Thuban is an interactive geographic data viewer. It has been developed because there was no simple interactive viewer for geographic information available as Free Software. Thuban is written in Python and C++ and uses the wxWindows library allowing it to run on many different platforms, including GNU/Linux and Windows.

Geographic data viewers are a necessary tool as they allow one to get a visual impression of the positional relationship of the information that may not be apparent from simple inspection of the data values themselves. Thuban allows the user to create a session that displays geographic data and then explore that data through navigation and manipulation of how it is drawn. The results can then be saved or printed.

Thuban arranges a session in a hierarchy. A session contains a map which consists of layers. Each layer represents one kind of data set. For instance, there may be a layer for roads and another layer for buildings. These layers can either be vector shapes or images.

1.1. Installation

Thuban is actively supported under Debian Testing (sarge), RedHat 7.2, and Windows 2000. Thuban depends on the following packages. These packages can also be found on the Thuban Download site .



Along with the source codes, the download page also offers full installation packages for Debian, Windows and RPM-based systems (Mandrake, RedHat, SuSE, etc).

1.1.1. RPM-based GNU/Linux Systems Installing Binary Packages

The most wide-spread RPM-based GNU/Linux Systems are RedHat, Mandrake and SuSE. The documentation of these distributions should contain information about how to install third-party RPM packages. Nonetheless, a short summary is provided here.

RPM packages can be installed applying several tools. The most basic one is the command line program "rpm". The hardware architecture is identified in the name of RPM packages, eg. 'i386' for most Intel/AMD architectures. If you have a different hardware architecture, where no binary RPM packages are provided, you must rebuild binary packages from the RPM source packages first (see below). Typical rpm commands look like:

				rpm --install Thuban-0.9.0-1.i386.rpm
Depending on what you already have installed on your system, you are informed that some packages are required, but not installed. You need to install them first. Either they are provided by your GNU/Linux distributor or available somewhere on the Internet. The more essential and special ones are provided together with the Thuban package.

For rpm exist some graphical user interfaces, notably kpackage, GnoRPM and xrpm.

Make yourself familiar with one of the tools and apply it to install the packages. Note, that you need to be administrator (root) for the system to do that. Build Binaries from Source Packages

This section describes howto build RPM install-packages from RPM source-packages. This adapts and optimizes an install-package specifically to your system. This is especially helpful to resolve version conflicts of dependent packages. Furthermore, install-packages for other platforms (e.g. PowerPC) can be created.

Note: rpm must be at least version 4. Execute rpm --version to find out about the version.

You need to do the following preparations to be able to build the packages as a regular user. You should now perform the package buling as root since this might cause damage to your system.

  • Create RPM directory structure: Choose a directory (e.g. $HOME/myrpm) and create the subdirectories BUILD, RPM, SOURCES, SPECS and SRPMS. A possible command sequence for this is:

						mkdir $HOME/freegisrpm
    						cd $HOME/freegisrpm

  • Set environment variable RPM_DIR:

						export RPM_DIR=$HOME/freegisrpm

  • Create $HOME/.rpmmacros: This file sets general preferences and some specific settings for signing packages. If you don't have a GnuPG-key, you can skip the signature settings i.e. drop the last 4 lines. A signature becomes important when you want to give away packages to third parties.

    %packager Name Lastname <Name.Lastname@mydomain.example> 
    %_topdir /home/mylogin/myrpm
    %_signature gpg
    %_gpg_name Name Lastname
    %_pgp_path ~/.gnupg
    %_pgpbin /usr/bin/gpg

Now you can install any RPM source-package. It's components are installed into the corresponding subdirectories of your rpm-directory. Essentially these are the sources (into directory SOURCES) and the so-called spec-file which contains all build instructions. The spec-file will go into the SPEC directory. Example: rpm --install Thuban-0.9.0-1.src.rpm

Create install-package: Go to the directory with the spec-files and rebuild the package:

cd $HOME/mypm/SPECS
rpm -bb thuban.spec
Next, you will find the newly created package in $HOME/myrpm/RPMS/i386. If you build the package for another architecture than i386, then the name of the directory has a corresponding name.

For documentation of RPM, either type man rpm or rpm --help. This will provide you with information on the various command line options of RPM. For more information see the homepage of RPM.

1.1.2. Win32 Systems

A common installation package of Thuban for Win32 systems is available from the Thuban website download section. This installation package is configured for displaying file based vector data (Shapefiles). For the display of raster data or the connection to spatial databases additional steps are needed.

The required Python packages are listed and linked on the download page as well. If you don't have Python installed already, download the packages for Python, wxPython for Python and the SQLite Python Libraries as well as the Thuban package. Install all four packages in the order: Python, wxPython, SQLite, Thuban. Follow the installation instructions provided by the seperate setups. The Thuban installation package will add an entry in the menu folder you configured. Raster Data: Installation of GDAL

Enabling the raster data features of Thuban is straight forward. For the examples we assume that Thuban has been installed under C:\Thuban:

  • Download the zip-archive gdal-win2k.

  • Extract the archive (e.g. with WiZ (InfoZip)) into the C:\Thuban\Lib directory of your Thuban installation.

  • Extent the PYTHONPATH environment variable (in your Windows Control Panel) to make the new libraries available for Thuban.


  • Extent also the PATH environment variable accordingly:


After this installation steps Thuban is ready to display raster data (e.g. the island.tif from the Iceland Demo data set. Working with PostGIS: Installation of PsycoPG

To access PostgreSQL/PostGIS spatial databases with Thuban you have to install the PsycoPG package for Windows:

  • Download the zip-archive

  • Extract the zip-archive into a directory either already in your PYTHONPATH or extent your PYTHONPATH variable to the directory you have extracted the archive to.

For installation and maintenance of spatial databases we refer to the PostGIS Homepage.