[Qgis-developer] Load R sp vector layers in QGIS

cfarmer cfarmer at uvic.ca
Thu Jun 19 03:30:34 EDT 2008

Hello lists,

Apologies for cross posting, but I thought this might be of interest to
all groups...

Thanks to the excellent work of Martin Dobias on the QgsMemoryProvider, I
have created a simple plugin which acts as an additional file type handler
for R sp vector objects in QGIS.

To use:
1) In R ( or manageR ;) ), create an sp vector object
(SpatialPointsDataFrame, SpatialPolygonsDataFrame, SpatialLinesDataFrame).
2) Save the sp object to a .Rdata file
3) Enable the plugin in QGIS (the button should appear in the file toolbar
along with 'add vector layer', 'add raster layer', etc..
4) Click 'loadRlayer' button, and browse to your .Rdata file
5) The plugin should do the rest, and voila! Your R spatial layer should
be displayed on the QGIS map canvas.

To get it:
1) It is available from: 'http://www.geog.uvic.ca/spar/carson/'
2) Add 'http://www.geog.uvic.ca/spar/carson/cfarmerQgisRepo.xml' to your
repositories list in QGIS

1) When possible, the spatial reference information is taken from the sp
2) The name is also taken from the sp object, not the name of the .Rdata file
3) Your .Rdata file should only contain a single sp object
4) I haven't tested this on multipoint or multiline features...?
5) You should be able to do all the normal things that vector layers in
QGIS can do (except for save edits).
6) Note that at this point, changes to the layer in QGIS will not be
reflected in the initial sp object, thus, this plugin is primarily for
visualizing your sp vector objects.

Hope you enjoy!


More information about the Qgis-developer mailing list