Home-range analyses in QGIS using R through Python

Anne Ghisla's Google Summer of Code project, mentored by Timothy H. Keitt

State of the art

Version 1.2.5 is available on Faunalia QGIS plugin repository (see Download section and NEWS file). Rpy is no longer supported, in favour of rpy2.

Download

The code is available on Faunalia QGIS plugin repository.

Just enable 3rd party repositories in Plugin Installer. The plugin is named HomeRange_plugin.

A SVN repository contains trunk and branches of the development. Contributors: please contact a.ghisla@studenti.uninsubria.it to ask for write access. It is important that you send patches against the current trunk, to spare time and energies... maybe the bug has already been fixed.

svn://home.prea.net/svn/HomeRange_plugin/

Documentation

Documentation is provided inside the plugin folder. A short tutorial is contained into doc subfolder. You can find suitable data on AniMove page.

Bug and wishlist

Testing is welcome! Bug reporting and wishlist about the plugin is provided by Faunalia: https://www.faunalia.it/animove/trac/.

Some discussion aroud HomeRange_plugin can be read on AniMove mailing list

For any other problem relative to plugin's dependencies (R, rpy, numpy, python itself, qgis) please browse the dedicated tracs.

Installation requirements and tested platforms

The plugin depends on:

Note that these requirements, except for R packages, are the same of Carson Farmer's manageR plugin.

Current (rpy2) working configurations:

Platform

QGIS

Python

R

RPy2

R packages

Debian testing

1.0.1

2.5

2.8.1

python-rpy2

adehabitat 1.8.2

Windows "stable"

1.0 preview II

2.5 + numpy1.1.0 + pywin32-210

2.7.1 and 2.8.0

1.0.3-R-2.7.0-win32-py2.5 / rpy2 2.0.0 a2 py2.5

adehabitat 1.7.2

Windows XP sp3

1.0.1 (OSGeo4W)

2.5.2 + numpy1.1.0 + pywin32-212 (OSGeo4W)

2.8.1

rpy2 2.0.3 (OSGeo4W)

adehabitat, rgdal, all their dependencies {*}

Old (rpy) working configurations (note: you often will need to purchase packages out from aptitude and similar tools, and HomeRange plugin v<2.0.0!):

Platform

QGIS

Python

R

RPy

R packages

Ubuntu 8.04 64bit

compiled 0.10

2.5

2.6.2

python2.5-rpy (1.0.1-1)

adehabitat 1.7.1

Ubuntu 8.10

1.0.1

2.5.2 + numpy1.1.1

2.7.1

rpy 1.0.3

adehabitat, rgdal, all their dependencies {*}

Debian Etch/Lenny

0.11 or 1.0 preview

2.5

2.7.1 and 2.8.0

python-rpy

adehabitat 1.7.2

Windows "oldstable"

0.9 and 0.10

2.5

2.6.2

RPy for <2.7.0

adehabitat 1.7.1

Windows XP sp3

1.0.1 (OSGeo4W)

2.5.2 + numpy1.1.0 + pywin32-212 (OSGeo4W)

2.6.2

rpy 1.0.3 (OSGeo4W)

adehabitat, rgdal, all their dependencies {*}

{*} Install them with the R command install.packages("<name of the package>", dep = TRUE)

<!> R 2.7.0 can't load adehabitat, because its latest version (1.7.2) requires 2.7.1. So R 2.7.0 is not suitable.

Platform notes

Gnu/Linux

MS Windows

Into the code: List of available layers

6th week report is about combobox population with all available point layers. It is possible to get the layer list from MapCanvas, i.e. the part of the main window where checked layers are shown. If no layer is checked, nothing is displayed in MapCanvas, and the retrieved list is empty.

I solved this retrieving the list of loaded layers from an instance of QgsMapLayerRegistry. This list contains all layers shown in Legend, both checked and unchecked. This way, the point layer named "samplepoints" is present in the box even if absent from the Canvas.

I guess it's a better implementation, because there is no need of displaying data when using my plugin. If the layers I'm working on are large, checking them in order to add them to the list of available layers could be a long and unuseful operation.

Here are a couple of screenshot:

Timeline

Week

Planned

Done?

Report

1 - from 26.5

polish R code, refactor, test

(./)

none

2 - from 2.6

set up repo and work on R code

(./)

link

3 - from 9.6

(prepare Java exam)

(./)

link

4 - from 16.6

set up the GUI

(./)

link

5 - from 23.6

work on GUI

(./)

link

6 - from 30.6

connected to R and QGIS Legend

(./)

link

7 - from 7.7

MCP analysis complete

(./)

link

8 - from 14.7

refactorisation

(./)

link

9 - from 21.7

merged python files into plugin.py, deep interface refactoring

(./)

link

10 - from 28.7

beta version, further functionality, testing

(./)

link

11 - from 4.8

improvements

(./)

link

12 - from 11.8

documentation

(./)

link

13 - from 18.8

(holiday in Belgium)

[link]

14 - from 25.8

[link]

GSoC2008Rbinding (last edited 2009-04-03 10:14:23 by AnneGhisla)