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

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 a new exchange set
    encExchangeSet = 
        new EncExchangeSet(new ArrayList<>(Arrays.asList("../Data/ENC_ROOT/CATALOG.031")));

    // load the exchange set
    encExchangeSet.loadAsync();

    // Asynchronous code run when exchange set loaded
    encExchangeSet.addDoneLoadingListener(() -> {
      //loop through the datasets and add to the map
      for (EncDataset encDataset : encExchangeSet.getDatasets()) {
        EncLayer encLayer = new EncLayer(new EncCell(encDataset));
        map.getOperationalLayers().add(encLayer);
      }
    });

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.

EncExchangeSet encExchangeSetUpdate = 
    new EncExchangeSet(new ArrayList<>(Arrays.asList("path/to/update", "path/to/original")));

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.

// Enables display of seabed information for all ENC layers
EncEnvironmentSettings.getDisplaySettings().getTextGroupVisibilitySettings().setIsNatureOfSeabed(true);

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.

// Perform an identify operation on the enc layer (you may want to loop through all layers)
ListenableFuture<IdentifyLayerResult> identifyLayerResultFuture = 
    mapView.identifyLayerAsync(encLayerToIdentify, clickedPoint, 10, false);

// wait for the result
identifyLayerResultFuture.addDoneListener(() -> {
  try {
    // get the result
    IdentifyLayerResult identifyLayerResult =  identifyLayerResultFuture.get();

    for (GeoElement geoElement : identifyLayerResult.getElements()) {
      // is it an enc feature?
      if (geoElement instanceof EncFeature) {
        EncFeature encFeature = (EncFeature) geoElement;

        // select the feature
        encLayerToIdentify.selectFeature(encFeature);
      }
    }

  } catch (InterruptedException e1) {
    e1.printStackTrace();
  } catch (ExecutionException e1) {
    e1.printStackTrace();
  }
});

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.
  • 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.