Following the publication of the first part of our work on Geopackages, our work with PostgreSQL/Postgis has enabled us to make a number of further advances. In this article, you’ll find an update to the QGis symbology for S57 files imported into a Geopackage. This update brings the number of layers supported by the symbology to 210. In a later article, we’ll publish an update of the traffic light symbology to support directional lights.
In the original article, we provided a layer_styles table for 157 S57 layers, the most common ones. In the PostgreSQL/Postgis project database, we imported 670 S57 files, enabling us to work on 210 S57 layers. In the rest of this article, you’ll find out how to download and add symbologies that may be missing from your project.
One layer in particular will be the subject of a separate article: lights, as we have evolved their symbology from the PostgreSQL/Postgis project.
New version of the “nautical” symbol directory
New symbologies require new svg symbols. A complete updated version of the ‘nautical‘ directory is available here.
Unzip the file and simply replace the ‘nautical‘ directory in the location you originally chose.
Missing layers in the first version
As the layer_styles table is a system table, we opted to integrate it into the geopackage when it was created. But when it comes to updating it, we can’t replace it, as any other changes you may have made would be lost. The procedure will then be:
- download the .qml style files for the missing layers
- display the missing layer in QGis
- load the .qml style file
- save the style as default, which will add the symbology to the layer_styles table
The .qml style files for all layers (V1 and V2) can be downloaded here.
Unzip the downloaded file into a directory of your choice. Layers with no symbology defined in layer_styles appear with a default symbology.
To apply the new symbology and save it as the default symbology in layer_styles, follow these steps:
Open the Layer Properties->symbology window.
Click on the “Style” button
Select ‘Load style‘ and point to the .qml file corresponding to the layer. The .qml file names are made up of the layer name followed by _pt, _pl or _li, depending on whether it’s a point, line or polygon layer. In fact, the same S57 layer may have one or more of these types. Make sure you select the .qml file corresponding to the layer type, otherwise you’ll get an error message.
Once the new symbology has been loaded, click on the Style button again and select Save as default. Click on the Datasource Database button.
Please note that there is no symbology defined for the S57 metadata layers: m_cscl, m_npub, m_nsys,m_sdat, m_srel and m_vdat. These layers do not need to be loaded into your project. If you do, a null symbology must be applied. There is no symbology for the magvar (magnetic variation) layer either, as its content is not a geographic object.
Updating the DEPARE layer (depths)
The symbology provided for the DEPARE layer is that corresponding to large- and medium-scale nautical charts (> 1:1,000,000).
For the visualization of very small-scale maps, we have modified the symbology to provide a more appropriate rendering.
The symbology automatically switches from one mode to the other at the 1:1,000,000 limit.
To replace the default symbology already present in layer_styles, follow the same procedure described above for the missing layers.