S57Manager: Manage S-57 ENC data in QGIS with PostGIS

Import, structuring and use of official nautical charts in a robust spatial database

S57Manager is a QGIS plugin that enables the structured import, validation and visualization of ENC (S-57) nautical charts using PostGIS or GeoPackage.


Introduction

Nautical charts in S-57 format (ENC – Electronic Navigational Charts) are official, structured, complex datasets with rich semantics.
While they are widely used in professional navigation systems, their direct use in a general-purpose GIS such as QGIS remains challenging.(->Why ENCs (S-57) are complex data)



The S57Manager plugin was created to address this issue:

to provide a reliable, structured and reproducible solution for importing, storing and displaying S-57 data in QGIS, relying on modern spatial databases.

In this first article, we present S57Manager as a whole, then focus on the PostGIS option, which is particularly well suited for professional, collaborative and multi-project workflows.

The plugin implements the automation of the processing chain described in the following two articles:

ENC charts in QGIS with PostGIS (1)
ENC charts in QGIS with PostGIS (2)


1. What is S57Manager?

1.1 Plugin objectives

S57Manager aims to:

  • import S-57 ENC files into QGIS
  • decode their complex structure (objects, attributes, geometries)
  • store the data in a normalized and usable way
  • facilitate visualization and filtering in QGIS

👉 The plugin is intended for:

  • GIS specialists
  • port authorities
  • consulting firms
  • technical services working with marine data


1.2 General architecture

  • Import via GDAL / OGR
  • Logical decoding of S-57 objects
  • Structured storage (PostGIS or GeoPackage)
  • Controlled display in QGIS
  • ENC-specific tools (usage purpose, scales, filters)


2. Why PostGIS for S-57 data?

2.1 The challenges of ENC data

ENCs are not simple vector layers:

  • very large number of tables
  • implicit relationships between objects
  • coded attributes
  • large data volumes
  • possible updates

PostGIS perfectly meets these constraints.


2.2 Advantages of PostGIS storage

With S57Manager + PostGIS:

✔ centralized storage
✔ high performance on large datasets
✔ advanced spatial queries
✔ multi-user access
✔ controlled backups and updates
✔ integration into existing GIS workflows


3. Configuring PostGIS mode in S57Manager

3.1 Connection settings

Connection settings for the Postgresql/postgis database are configured directly in QGIS. The plugin searches for and displays the connections available in the current project:


3.2 Structure of generated tables

When you click OK in the previous dialog box, the plugin checks for the existence of five schemas in the selected database and creates them if necessary:

  • enc, main schema where all imported S57 files will be stored
  • linesenc,pointsenc and polysenc, temporary import schemas. They host ogr imports to enable the necessary operations on the geometries. Once the processing is complete and the final data has been copied to the enc schema, they are emptied.
  • encm, not currently used but planned for future versions.

The ENC schema contains all the tables from the S57 files.

  • Separation by geometry type (points: pt_, lines: li_, polygons: pl_)
  • S-57 object tables
  • Relationship tables
  • RCID identifier management

👉 The schema is designed to be readable, documentable, and queryable.


4. Importing an S-57 ENC into PostGIS

4.1 Launching the import

The plugin searches for and loads all .000 files in the directory and subdirectories and performs the following:

  • selection of S-57 files
  • progress tracking
  • display of detailed logs


4.2 Control and validation of ENC data in PostGIS

Importing ENC data into PostGIS is only a first step.
Before any cartographic or analytical use, it is essential to carry out rigorous quality control.

As ENC data are standardized and critical for maritime safety, any structural or interpretative error may lead to inconsistent—or even dangerous—results.

Quality control relies on three complementary pillars:

  • verification of imported layers
  • geometric integrity
  • attribute consistency


4.2.1 Verification of imported layers

After importing into PostGIS, the first check is to ensure that all expected object classes are present.

Presence and completeness

Depending on the ENC content, one should notably find:

  • hydrographic objects (depth areas, soundings)
  • coastline and land areas
  • aids to navigation
  • hazards and obstructions
  • regulated or special areas

The absence of a layer may indicate:

  • an error during import
  • unintended filtering
  • incompatibility with the S-57 version used

Logical organization

In PostGIS, data can be organized:

  • by schema (hydrography, navigation, regulations, etc.)
  • by geometry type (points, lines, polygons)
  • by S-57 object class

Clear structuring facilitates:

  • maintenance
  • understanding by third parties
  • automation of processing

👉 S57Manager helps maintain a readable organization compatible with GIS best practices.


4.2.2 Geometric integrity

ENC data rely on shared and topological geometries, which makes their import more delicate than a classic vector dataset.

Valid geometries

It is essential to verify that:

  • polygons are closed
  • geometries are not self-intersecting
  • lines are not degenerated
  • points are not unnecessarily duplicated

In PostGIS, validation functions make it possible to:

  • detect invalid geometries
  • correct them if necessary
  • document anomalies

An invalid geometry may:

  • prevent display in QGIS
  • distort area or distance calculations
  • block subsequent spatial operations

Topological consistency

Even if S-57 topology is not always preserved exactly after import, certain rules must remain consistent:

  • a depth area must not arbitrarily overlap a land area
  • the coastline must correspond to the land/sea boundary
  • point objects must be located in logically compatible areas

These checks are particularly important during data aggregation or generalization.


4.2.3 Attribute consistency

S-57 attributes are both rich and constrained.
They must be checked with the same level of care as geometries.

Presence of essential attributes

Each object class includes attributes that are:

  • mandatory
  • conditional
  • optional

The absence of a key attribute may indicate:

  • an import error
  • misinterpretation of the S-57 schema
  • information loss during conversion

Coded values and domains

Many attributes use:

  • coded numeric values
  • closed lists defined by the IHO

It is crucial to verify that:

  • values fall within authorized domains
  • codes match their intended meaning
  • fields do not contain aberrant values

An incorrect value can affect:

  • cartographic interpretation
  • object hierarchy
  • display or priority rules

Semantic consistency

Finally, some checks are a matter of nautical common sense:

  • a hazard cannot be located on land
  • an aid to navigation must be consistent with its environment
  • a regulated area must have a compatible type and category

These cross-checks are often facilitated by:

  • PostGIS spatial queries
  • joins between layers
  • visualization in QGIS


Why these checks are essential

PostGIS offers exceptional analytical power, but it does not automatically correct semantic or normative inconsistencies.

In the case of ENC data:

  • data quality directly conditions reliability
  • errors may propagate through analyses
  • an initial quality check prevents downstream issues

👉 S57Manager follows this approach:
not merely importing data, but importing it cleanly, with respect for both the structure and the nautical meaning of the data.


5. Use in QGIS

5.1 Display by object families

Given the richness and density of ENC data, displaying all layers simultaneously quickly results in an unreadable map.
A recommended practice is to organize the display by object families, i.e. by major functional groups sharing a common nautical logic.

For example:

  • hydrographic objects (depth areas, soundings, isobaths),
  • coastline elements and land surfaces,
  • aids to navigation (buoys, lights, beacons),
  • hazards and obstructions,
  • regulated or special areas.

In QGIS, this organization can be implemented through:

  • layer groups,
  • shared styles by family,
  • conditional display filters,
  • or distinct schemas on the PostGIS side.

Displaying data by family offers several advantages:

  • it facilitates progressive map reading by revealing information through logical layers;
  • it allows quick visual checks of data consistency (missing objects, positional anomalies);
  • it prepares the ground for advanced styling, close to S-52 rules, without attempting to reproduce them fully.

👉 S57Manager follows this logic by preserving a structure compatible with ENC object families, allowing users to build readable, scalable QGIS projects adapted to their needs.


5.2 Filtering displayed layers

The “ENC Tools” menu allows filtering of displayed layers according to usage and/or display scale.

Filtering by purpose

ENCs are designed for very different uses, ranging from route planning to coastal or port navigation.
This diversity is formalized by the concept of purpose, which corresponds to the cartographic usage level of the data (general, coastal, approach, harbour, etc.).

Applying a purpose-based filter makes it possible to display only objects relevant to a given context, avoiding visual clutter and unnecessary information at the considered scale.
An object that is valid in a general navigation ENC may become inappropriate—or even misleading—in a harbour context, and vice versa.

In a PostGIS / QGIS environment, this filtering can be implemented:

  • via attributes inherited from the ENC import,
  • through SQL views dedicated to each purpose,
  • or via scale-dependent visibility rules.

The benefits are multiple:

  • improved cartographic readability, adapted to the expected level of detail;
  • consistency between scale, usage and content;
  • a solid basis for differentiated styles according to navigation context.

👉 S57Manager facilitates this filtering by preserving purpose information during import and enabling layers and queries to be structured according to targeted uses, without imposing rigid symbolization.

Display scale

In ENCs, scale is not a simple cartographic parameter: it conditions the very validity of the displayed information.
Each object is designed to be interpreted within a given scale range, closely linked to its purpose and level of generalization.

Displaying an object outside its scale domain may lead to:

  • loss of readability (excessive object density),
  • false precision (over-detailed objects at small scale),
  • or even misinterpretation by the end user.

Managing display scale therefore makes it possible to:

  • automatically adapt layer visibility to zoom level,
  • preserve consistency between geometric detail and usage context,
  • bring QGIS behaviour closer to that of an ECDIS, while retaining GIS flexibility.

In a PostGIS or GeoPackage architecture, this logic can be implemented through:

  • scale ranges defined at layer level,
  • views or queries filtering objects according to the current scale,
  • or a combined purpose/scale approach for finer control.

👉 S57Manager provides tools to define and adjust minimum and maximum display scales for selected layers, enabling progressive, readable cartography consistent with the ENC philosophy, without unnecessarily complicating the QGIS project.


5.3 Custom symbolization

When S-57 layers are loaded directly, they appear as points, lines and polygons with default symbology, far removed from a nautical chart.
S57Manager makes it possible to directly apply an ECDIS-like symbolization.

This requires two steps:

  1. Installing the required SVG symbols
    These symbols are included in the plugin and are installed in the user profile by clicking the “Install SVG symbol library” button in the S57 Options dialog.
  2. Installing default symbolization in the PostGIS database
    The “Install default S57 symbology” button checks whether the layer_styles table exists in the public schema of the PostGIS database.

    • If it does not exist, it is created and the default symbology for the 260 S-57 layers is added.
    • If it already exists, the default symbologies for the 260 layers are added to the existing ones.


Conclusion

The PostGIS mode of S57Manager provides a robust solution for the long-term integration of ENC data into a professional GIS.
It is clearly aimed at environments where durability, performance and collaboration are essential criteria.

👉 In the next article, we will see how S57Manager enables a lighter and more autonomous approach through the use of GeoPackage.


Si cet article vous a intéressé et que vous pensez qu'il pourrait bénéficier à d'autres personnes, n'hésitez pas à le partager sur vos réseaux sociaux en utilisant les boutons ci-dessous. Votre partage est apprécié !

Leave a Reply

Your email address will not be published. Required fields are marked *