Display electronic navigational charts

Electronic navigational charts (ENCs) are georeferenced vector datasets for the visualization and analysis of hydrographic and maritime information. ArcGIS Runtime supports ENCs that conform to the International Hydrographic Organization (IHO) S-57 standard. Use ENCs in your ArcGIS Runtime apps to:

  • Visualize S-57 data in compliance with S-52 standards and specifications for chart content display
  • Use maritime data as an additional data source for situational awareness and decision making
  • Combine S-57 datasets with other sources of information for geospatial analysis

Get started

Before ENC data can be displayed in an application, you must add code to:

  • Set the path to the resource directory that contains the styles required to render the ENC data. The directory contents is available for download from developers.arcgis.com.
  • Set a location for the SENC data. The first time that ENC data is displayed it is processed and placed into the SENC directory. Subsequent displays of the ENC data will be faster because the data is already processed and is read directly from the SENC directory.
// get EncDisplaySettings instance
EncDisplaySettings* displaySettings = EncEnvironmentSettings::displaySettings();


// set paths
EncEnvironmentSettings::setSencDataPath(sencDataPath);
EncEnvironmentSettings::setResourcePath(resourcePath);

Display an electronic navigational chart

ENC data is distributed as cells, or collections of cells, which are exchange sets. An exchange set is composed of a single catalog file along with dataset files (cells) for specific geographic extents. Cells can be loaded individually or as part of an exchange set.

ENC layers are constructed from ENC cells. A cell can be constructed from a dataset or from a path. When cells are distributed as part of an exchange set, always use the dataset-based constructor. Cells loaded from a path directly will not include any updates that were distributed as part of the exchange set. You can add all of the cells in an exchange set to a map by iterating through the loaded exchange set’s datasets.

To add an exchange set to your map view, create a new exchange set object and provide the file path to a catalog file (named "CATALOG.031" per the specification). If the catalog file you are processing represents updates only, then you must provide the path to the original catalog file plus the update catalog file(s). See Working with updates for more information.

Once the exchange set is loaded, iterate through the datasets property and construct cells from each data set.

// create EncExchangeSet using paths
EncExchangeSet* encExchangeSet = new EncExchangeSet(paths, parent);


// get the list of EncDataset
QList<EncDataset*> EncDatasets = encExchangeSet->datasets();


// display the names of EncDataset
for (EncDataset* EncDataset: EncDatasets)
{
  qDebug() << EncDataset->name();
}

Working with updates

ENC charts are often distributed as base cells (.000 files) with one or more update cells (.001, .002, etc. files). An exchange set can consist exclusively of update cells; in order to load an update exchange set, the path to the base exchange set must be provided simultaneously.

When loading an ENC cell, it is important to use the dataset-based constructor. If updates for a cell are part of an exchange set, they will only be found by the runtime when the dataset-based constructor is used. Loading the cell from a path will not load any associated updates.

Set ENC environment settings

ENC layers are displayed in accordance with the IHO S-52 standard. You can define the display properties of your ENC layers by using the static EncEnvironmentSettings class. These settings apply to all ENC layers in all maps. Settings fall under three categories: mariner settings, text group visibility settings, and viewing group settings. Text group settings control the display of labels for features, mariner settings control the symbolization and presentation of ENC features, and viewing group settings allow for quickly applying settings to logical groups of feature types.

// get ENC text group visibility settings object
EncTextGroupVisibilitySettings* encTextGroupVisibilitySettings = EncEnvironmentSettings::displaySettings()->textGroupVisibilitySettings();


// set properties
encTextGroupVisibilitySettings->setImportantText(false);
encTextGroupVisibilitySettings->setNatureOfSeabed(false);

Runtime’s ENC implementation works with ENC content via compiled SENC files. SENC is an acronym for System Electronic Navigational Chart. After an ENC cell has been loaded, all future loads of that cell will reference the underlying SENC file directly. You can use the sencDataPath property of the environment settings to find or set the location where SENC files are stored.

Identify and select ENC features

ENC layers support identify through the common geoview feature identification mechanism, which takes a screen point and tolerance in pixels. Identify will return a collection of IdentifyLayerResult objects, one per matching layer. For ENC layers, the results will have a geoElements property, which is a collection of EncFeatures.

Once a feature has been identified, you can call selectFeature on the layer that contains the feature to select it.

Performance Considerations

Runtime works with ENC content via internal SENC files. When an ENC cell is loaded, an SENC representation is generated. Subsequent loads only read the generated SENC files. When developing Runtime apps for working with ENC content, understand that:

  • The SENC data path must be set before attempting to read ENC content.
  • SENC files are device- and version-specific. These files should not be exposed to users, backed up, or shared between devices. The SENC format is internal to Runtime and may change between versions. On iOS, consider setting the SENC path to a subdirectory of the documents directory that is excluded from iCloud and iTunes backup. See Apple Technical Q&A QA1719 for more information about excluding iOS directories from backup. See the Android Developers topic for more information about excluding directories from backup on Android.
  • SENC files take time to generate - this will delay the loading of new ENC cells. It may take a long time to load large ENC exchange sets consisting of many cells - potentially hours. Never block the UI when loading these files.
  • Because the initial load of an ENC cell (before the SENC files have been generated) can take some time to complete, consider pre-loading them to ensure availability before depending on them for navigation.
  • Do not attempt to read or manipulate SENC files. Changes to generated SENC files will invalidate them, requiring Runtime to re-generate them the next time the corresponding cells are loaded.