r-spatial / RQGIS3

GNU Lesser General Public License v3.0
69 stars 19 forks source link

RQGIS# not working if invoked from Rscript using a remote connection (ssh) #6

Closed iquincoces closed 5 years ago

iquincoces commented 5 years ago

When trying to use RQGIS3 inside an script that is sent to different servers, that locally worked perfectly, using a SSH connection a qt5 window creation fail crashes the script.

The only work arround we have found is to insert a "export DISPLAY=:0" command before invoking Rscript.

Best

pat-s commented 5 years ago

This is expected as QGIS tries to open a X Display on a machine without a display. We do not yet support running RQGIS on a server by default but you already figured out a workaround :)

We are also using the same way to run RQGIS on Travis.

jannes-m commented 5 years ago

Usually, when running RQGIS3 on the server, there should at least appear a message telling the user what to do to run RQGIS3 on a server:

system('export DISPLAY=:99 && xdpyinfo -display $DISPLAY > /dev/null || sudo Xvfb $DISPLAY -screen 99 1024x768x16 &')
pat-s commented 5 years ago

He/she was calling RQGIS from his local machine sending the jobs via SSH to the server. I think our checks do not catch this since the call is evaluated locally in the first place.