[R] [External] GIS in R vs QGIS

Barry Rowlingson b@row||ng@on @end|ng |rom |@nc@@ter@@c@uk
Fri Sep 9 11:03:43 CEST 2022


On Thu, Sep 8, 2022 at 2:01 PM Nick Wray <nickmwray using gmail.com> wrote:

> A bit of a philosophical question maybe?  I am no expert in R but I feel at
> home in it.  On the other hand I have been wrestling with QGIS, buying
> books on it, finding online guides etc and I'm still finding it really
> tricky.

R is a programming language, designed for working with data, and
there's add-on packages for spatial data. Once you know how to get and
set aspects of the spatial data objects,
you can do anything computable on spatial data objects. This is true
for any programming language with spatial data packages, such as
Python or Javascript.

If you are wrestling with QGIS to do stuff that you find easy in R,
then you are probably trying to do something "programmatic" in QGIS.
Its data structures are more limited, basically
to spatial features and tables. Without resorting to Python code
(which is integrated into QGIS) there's not a lot you can do to make
repetitive activity easy in QGIS, although there's
the graphical analysis pipeline builder in the toolbox which can be very useful.

What I mostly use QGIS for is input, editing, and visualising multiple
layers of spatial data. There are things that QGIS cartographic engine
can do easily that R's graphics cannot do.
Although you can make "publication quality" maps in R, if you want
high quality cartographic output then it's more easily done in QGIS.

> For my research I need to analyse both topological data (locations
> of streamflow gauges for example) and vector data such as precipitation or
> temperature.  There seems to be a fair amount of geospatial stuff in R, as
> well as books like Robin Lovelace's, so I am wondering whether I can throw
> aside the QGIS stuff and do everything in R with the needed packages etc.
> It would give me a lot more time, if nothing else.

 I'd suggest you do your analysis in R (there are also R packages that
let you use QGIS' processing algorithms if you need them, and also
GRASS and other GIS tools). But if you want to
map your gauges over a base layer and zoom and pan to inspect it, or
you need fine adjustment of mapping output, then use QGIS.  R and QGIS
can both use open spatial data formats
for interoperability, so if you save from R into a GeoPackage then
reading it in QGIS is easy, and vice versa.



More information about the R-help mailing list