[Qgis-developer] QGIS remote control API

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Mar 13 08:45:42 PDT 2017


My first job was in integrating spatial statistics and GIS. In those
days (1990) that meant Arc/Info version 4 and FORTRAN, until we
discovered S-Plus and ditched Arc/Info for real statistics software.

Twenty six years on and still thinking about integration. Some of you
may have seen my very sketchy R package that starts up a map canvas
and layer list and then lets R users add map data to the canvas. It
works via a libpython interpreter loaded into R and then making PyQGIS
API calls. My GSoC 2017 proposal is basically improving and extending
that.

But I've leant towards a slightly different idea - remote control of a
QGIS instance. There exists already a QgsRemoteControl plugin which is
intended to keep two QGIS instances in sync with respect to projection
and extent etc. But what I'd like to do is have an HTTP API that could
also add and modify data layers to a running QGIS, potentially from
any client.

So once set up, you could do:

 wget http://localhost:17919/zoom?extent=...

 wget --post-file=map.json http://localhost:17919/addlayer

and so on. Then any "mapping deficient" programming language or system
could then have a client written for that API and use whatever
functionality is exposed by it.

 I've already got a basic HTTP server that runs in Qgis and accepts
requests, and it uses the Qt event system so is totally non-blocking
(except when actually processing a request).

 Is this a good idea/useful idea/dumb idea? I can rewrite my GSoC to
more reflect this idea if its thought useful. I have been contacted by
a possible student with an interest.

Barry


More information about the Qgis-developer mailing list