6

I went into some troubles when making my first steps with QGIS server and I could not find an easy way to go.

Some context

My projects files (qgs/qgz) are on a remote server (Ubuntu based, headless, i.e. no GUI), where they are exposed to the web, mainly for serving raster files through the OGC WM(T)S protocol and some vector data from PostGIS to many depending applications in a larger infrastructure.

Whenever I want to change/update something in a project, I have to copy the project file over SSH to my local computer, work on it, then push it back again on the server.

This is not optimal, mainly for 3 reasons;

  1. Version mismatch: my local version of QGIS is more recent than on the server. Hence, I may get into troubles...
  2. File paths: paths of, for example, raster data are obviously not the same on my machine than on the server. I have to tweak in either way or the other, and it's especially painful to work with extra large raster. I don't want to transfer these files locally. And trying to simulate their existence locally by small subsets is OK but it involves some manual processing and, therefore, is prone to errors.
  3. Remote database: I've to manage to connect to the remote PostGIS using an SSH tunnel or to duplicate the database locally, which in case of a large database is not possible.

Some pseudo-solutions

With these findings, I see two possibilities (but I probably missed the obvious ones), with pros and cons for each:

  1. Editing the raw XML: I tried to directly edit the XML based project file on the server, but it's definitely not the way to go as it becomes a really huge file; you quickly miss something or even break it. And this of course doesn't work with qgz files.

  2. Installing a GUI: In order to spare resources, I also want to avoid the installation of a graphical interface on the server (which would naturally make it possible to remotely work on the project solving all the previously described problems, but which need a good VPN connection).

I probably don't work in the right manner (is there just one?) with remote QGIS project files which are used/served by QGIS server.

Question

So, how do you manage to work cleanly and rigorously with remote QGIS project files, are there currently recognized best practices?

1
  • Pretty much the same situation here, QGIS Server running in a Docker container on a headless Linux machine. Editing .qgs files involves heavy lifting with SCP or rsync. I will not install X11 on the server just to RDP into QGIS Desktop. Have you found any solution? I've been thinking about exposing the QGIS projects directory over SMB.
    – Jacob
    Commented Jun 18, 2021 at 13:00

1 Answer 1

0

About version mismatch, best way to keep version up to date is to.. make update, the easiest way is to use docker for that.

About path files. Personally all my project are in relative path and I keep ale files used by that project in project folder. After setup everything I just delete local files. If I need to make any change, just downloaded files from server. In case of some new layers, old ones that is not present locally and qgis don't load them, he will ask you to leave, update or delete layers, just leave as is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.