Storing your QGIS projects and other files

Your Lizmap instance must access to your QGIS projects. Therefore you have to upload your QGIS files into a personal storage space that Lizmap Hosting provides with your Lizmap instance.

You access to this file storage with the FTP protocol. The storage has few predefined directories:

Sending files with FTP

We recommend to use the FTP client WinSCP (or FileZilla if you are using another system than Microsoft Windows). You can download them on their respectif official web sites:

You’ll find a little tutorial to know how to use these softwares:

Parameters to set:

  • TLS is enabled on our FTP servers, so use explicit FTP over TLS if available. This is more secure than a classic connection. Be sure you choose an explicit connection instead of implicit, because the later use some network port that are not opened on our servers.

  • The SFTP protocol is not supported.

  • Configure the access with the login and the password we give you.

  • You can use either the passive or the active transfer mode.

If you have some difficulties to connect to our FTP server, probably you have a a firewall which blocks communications. You should verify that it allows the FTP protocol.

The FTP protocol has two transfer mode, passive and active, which need a specific configuration into firewalls.

  • For the active mode, your proxy or firewall should authorize the communication to internet on the port 21 and should authorize connection from the internet on the port 20.

  • For the passive mode, your proxy or firewall should authorize the communication to internet on the port 21 and 5700 to 5900. This is often the mode you could use, as firewalls don’t often accept connections onto port 20.

You FTP client use one of these two mode, automatically or the one you indicate explicitly.

The QGIS directory

You must organize your files as recommended into the Lizmap documentation: You should have several directories, containing themselves QGIS projects.

QGIS projects are at least *.qgs and *.qgs.cfg files. You can have also additional files like CSS, rasters, geojson etc.

Example of organization into your Lizmap Hosting storage space:

qgis/
   rep1/
     project1.qgs
     project1.qgs.cfg
     project2.qgs
     project2.qgs.cfg
   rep2/
     project3.qgs
     project3.qgs.cfg

Using SVG files in your QGIS projects

You can use images in SVG format in your QGIS projects. There are several techniques with advantages/disadvantages.

Some techniques work perfectly in certain QGIS contexts, but occasionally QGIS server may have a bug rendering SVG graphically in certain contexts: map, main map legend, legend or logo in a PDF layout.

The centralized folder technique is preferred only if the previous techniques are not working correctly.

1. Embedded SVG

It is possible to use embedded SVG. It’s quick and easy to use, but the file is embedded in the project itself.

2. File in ‘media’ folder

  1. Store your files in a sub-folder of the media directory (which have to be created manually, following the Lizmap documentation). The naming of the sub-folder is free.

  2. In QGIS, use the file from the media folder.

  3. Make sure you send the file tree to your server

Tip

Only for debugging purposes, in the QGIS file, there must be a path relative from the project concerning the use of the image, containing media/.

3. SVG centralized folder

QGIS allows you to define a centralized folder at the global QGIS level, allowing you to have a “library” that centralizes SVGs. This method is more complete, but requires the folder to be set up locally on QGIS Desktop.

On our hosting, you have a folder that can contain SVGs for each Lizmap instance. You’ll find this folder in qgis/resources/, then it’s the folder starting with svg_.

Example: qgis/resources/svg_1234. The 1234 suffix is random and unique for each instance.

Warning

You must not change this name, nor delete the directory.

To be able to use SVGs in your projects with this folder, you will need to create this centralized folder locally on your your computer.

Let’s take a folder with the name svg_1234 as an example:

  1. Download the resources directory and its contents via FTP, mainly the directory starting with svg_. Put this directory at the same level as the other project directories, so as to have the same tree structure as on the server.

  2. In QGIS, go to Preferences ‣ Options ‣ System, and add the resources folder as the SVG folder. Warning, do not add one of the sub-directories of resources, but the resources directory itself.

  3. Store your SVG files in this directory resources/svg_1234.

  4. In the QGIS project, when configuring layer symbology, use the SVG files from resources/svg_1234. Then save the project.

  5. Send your projects and the contents of resources/svg_1234 to your Lizmap server via FTP. You should be able to see your SVGs in your maps in Lizmap.

Tip

Only for debugging purposes, if this doesn’t seem to work, you can check the QGIS file contents. If you open the QGIS project in a text editor, you should find lines like <Option type="QString" value="svg_1234/image.svg" name="name"/>. The value of value must begin with svg_1234/.