Monday, July 16, 2012

Getting the SDA2PP plugin to work in QGIS. RPy2

Installing this plugin has proved to be a prolonged process.  I want to do Krigin and other interpolations in QGIS and have tried to install this plugin for these purposes.

To start off with the plugin was not even available on the list under Plugins>Fetch Python Plugins

After some searching and experimeting i found the plugin by selecting show all plugins, including experimental ones, although it does not appear to be experimental.
After selecting this option it became clear that much previous packages etc are required. These include rgdal, sp, RPy2, pywin32, numpy and an update of the python framework on my machine.  I am using a 64bit machine but it is not easy to work within a 64 bit pytho framework as many of the additional packages and moodules are not easily obtainable for 64 bit but only in 32 bit.  I therefore have kept to 32 bit to save headaches.

Most of the installs are not too complicated and can be found easily.  However I have struggled to install RPy2.

There is no precompiled self installing package for Rpy2 so it has to be done in another way.  The recommended way that i have had the most success with is using easyinstall, part of a package that is called setup tools.  I was able to install this package without any problems but could not get easy install to work.  Easy install downloads and installs packages etc from PyPI with the simple command
>easy_install rpy2
It is not all that simple however.  For this command to work the following is necessary after installation:

  • Ensure that the Command Prompt is being used and not the Python command line.
  • The Path variable needs to contain the directory in which easy_install.exe is... C:\Python27\Scripts\
  • The path also needs to contain a directory for the R executable.
Changing the Path variable is done as shown in the following figure


http://code.google.com/p/sda4pp/downloads/detail?name=SDA4PP-System-0.9.0.exe&can=2&q=#makechanges

Installing Rpy2 on windows does not appear to be possible at this stage.  I am switching to linux.