proguide_512
proguide_512
proguide_512
Version 5.12
Programming Guide
May 2010
SevenCs GmbH
Ruhrstrasse 90
22761 Hamburg
Document Authorization
Project Manager
_______________________________________
Olaf Wentzel
All rights reserved. No part of this document may be reproduced, in any form or
by any means, disclosed or used by any person who has not received prior written
authorization from SevenCs GmbH.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page ii
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Preface Page iii
Preface
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page iv
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Contents Page v
Contents
Preface ...........................................................................................................iii
Contents.......................................................................................................... v
1 Introduction....................................................................................... 1
1.1 Summary: the Chapters in this Document............................................ 1
1.2 Conventions Used in this Document .................................................... 2
2 Background Information.................................................................. 3
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page vi
5 How to Start..................................................................................... 23
5.1 Compiler Settings................................................................................23
5.2 Command Line Example Programs ....................................................24
5.2.1 Readcat................................................................................................24
5.2.2 Readhead .............................................................................................26
5.3 Showcell Example...............................................................................28
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Contents Page vii
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page viii
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Contents Page ix
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page x
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Contents Page xi
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page xii
20.8 Glossary.............................................................................................380
20.9 Standards for ECDIS and ECDIS Data .............................................383
20.10 Open SSL Licence.............................................................................384
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
1 Introduction Page 1
1 Introduction
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 2 1 Introduction
Note:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
2 Background Information Page 3
2 Background Information
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 4
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
3 Installation and Configuration Page 5
Note:
The Presentation Library is provided by SevenCs in an enhanced version as an
integral part of the EC2007 software package. We recommend purchasing a
copy from the IHB in Monaco, though, for legal use in ECDIS products.
For the address of the IHB see page 335.
However, we recommend using the SevenCs version in order to get the best
performance.
The EC2007 ECDIS Kernel Library has been ported to a number of platforms,
compilers, and operating systems:
Note:
Running the ECDIS Kernel software on systems with other configurations
may cause problems or performance loss.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 6 3 Installation and Configuration
Note:
The default destination is C:\SevenCs\EC2007. A different path can be
entered during setup.
There are two environment variables LIB_7CS and CFG_7CS which must be set
to a path on the local disk. The Kernel software will always search for needed
files in the directories specified by these environment variables.
If no environment variables are given the default settings are:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
3 Installation and Configuration Page 7
The CD-ROM supplied contains installation archives for the specific hardware
platform. If available, you can use a software manager for the installation of the
package. On some platforms the archives must be unpacked manually.
lib512_linux.tgz
This archive contains the following directories:
data.tgz
This archive contains the following directories:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 8 3 Installation and Configuration
Additional files:
tools/unix/acrobat/ Acrobat reader files, all platforms
Copy files:
Mount the CD-ROM.
Use gzip/tar to extract all archive files to your local disk.
Default destination is /usr/local/. Create this directory if necessary.
If no environment variables are given the default settings are:
LIB_7CS = DATA_7CS = BIN_7CS = /usr/local/
CFG_7CS = $LIB_7CS/lib/config
Note:
It is important to set the variable CFG_7CS to a writable path on the local
disk.
The Kernel software will always search for needed files in the directories
specified by these environment variables. If you want to install the ECDIS Kernel
in a directory different from /usr/local/ (e.g. /home/ecdis), you must set
the following environment variables:
LIB_7CS=/home/ecdis for library files (fonts, object catalogues,
and Presentation Library files)
DATA_7CS=/home/ecdis for S-57 data and binary cells
BIN_7CS=/home/ecdis for executable files
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
3 Installation and Configuration Page 9
After the ECDIS Kernel has been installed the SevenCs software registration
scheme described in chapter 19 Software Registration requires additional
preparation:
Set the access flags of the config path to read-write access for all users
(chmod 777).
Verify that the file 'EcRegMsg' is copied to the path CFG_7CS.
This file is binary and must be executable with setuid root.
To change the x flag, login as root and execute the commands
cd /usr/local/lib/config // use default config path
cd $CFG_7CS // or user-defined path
chown root EcRegMsg // change owner
chmod a+xs EcRegMsg // set x with suid
chmod a+w . // set write permission for
//config path
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 10 3 Installation and Configuration
The following directory structure is necessary when using the ECDIS Kernel:
$LIB_7CS/lib/fonts/ fonts
$LIB_7CS/lib/objcat/ S-57 catalogues
$LIB_7CS/lib/config/ configuration files
$LIB_7CS/lib/preslib4/ S-52 presentation library
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
3 Installation and Configuration Page 11
3.6.1 General
In case an application shall be registered and a dongle shall be utilized the
appropriate dongle drivers have to be delivered to the end user.
Note:
Installation requires administrator rights.
When regtest.exe is called a DOS window temporarily opens. To prevent
this call regtest-quiet.
Note:
Installation (registration) requires administrator rights.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 12
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
4 Kernel Overview Page 13
4 Kernel Overview
This chapter contains fundamental information about the design of the EC2007
ECDIS Kernel that is helpful to understand and use this software.
A list of all Kernel functions including their descriptions and parameter lists is
contained in the following files:
Windows NT: /docu/kernel/eckxx.hlp
UNIX: /docu/kernel/html-xxx
Note:
We recommend to have the file available when using the ECDIS Kernel
software.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 14 4 Kernel Overview
The main data flow starts with the import of chart data in the ENC S-57 format
(files with the extension *.000). These chart data are converted into a binary
format and stored in the System Electronic Nautical Chart, or SENC, database
(files with the extension *.7CB). All subsequent processes access the data in the
SENC together with the data in the Object Dictionary.
In order to display the chart data they have to be further prepared. The
information from the Presentation Library, the Object Dictionary, and the SENC
are used to create drawing instructions that are stored in the Display List. These
data can be either printed or displayed on the computer monitor.
The following section gives a more detailed description of the function sets and
groups provided by the EC2007 ECDIS Kernel.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
4 Kernel Overview Page 15
4.2.1 EC27_S57
During operation an ECDIS accesses all chart information from its SENC. The
system therefore must be capable of importing new charts or updates from official
and private sources and converting them into the binary format of the SENC
database.
The group Dictionary Access includes functions to access the object dictionary.
Since most ECDIS Kernel functions handle objects they need object relevant
information from the object dictionary. With the function of this group the object
dictionary can be read and information extracted. See Chapter 7 The Object and
Attribute Dictionary for more Information.
The group S-57 Data Access includes functions to read and convert S-57 data, the
official IHO data exchange format for vector navigational charts. From Kernel
version 5.0 onward the old S-57 version 2.0 (DX90) is no longer supported, only
the S-57 format edition 3.x is.
Using this function group an ECDIS can read any digital chart of these formats,
and store the information in the SENC.
The group S-57 Data Update includes functions to apply update messages in the
S-57 edition 3.x format on the SENC data. See Chapter 12 Automatic Updating
for more Information.
The group S-57 Exchange Set includes functions to access the S-57 catalogue file,
which is contained in the IHO data exchange set.
4.2.2 EC27_ARCS
Chart data for ECDIS are usually supplied in vector format. However, until global
vector data coverage is available there is a need to display raster information to
bridge the coverage gap.
The EC27_ARCS function contains groups of functions to read and display
ARCS raster charts and to support the ARCS automatic updating mechanism, as
well as to handle the ARCS security scheme.
The function set also cooperates with the function set EC27_Draw by using the
same computer memory to prepare the chart image before copying it to the screen.
This allows a vector overlay on top of the raster chart which makes it possible to
e.g. plan a route in the S-57 vector format. See separate document ‘ARCS
function library’ for more information.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 16 4 Kernel Overview
4.2.3 EC27_BSB
The EC27_BSB function contains groups of functions which support loading and
displaying raster charts in BSB format. The core routines are included in a set of
separate DLLs, whereas the Kernel provides an interface compatible with other
function sets. For more information see chapter 9.4 BSB Raster Data.
4.2.4 EC27_SENC
Following the IMO/IHO specifications, an ECDIS stores its charts in the SENC.
The SENC is a database which results from the conversion of the S-57 database
(ENC) (see EC27_S57). It enables a fast display of vector chart data and queries
to be performed on the associated descriptive data.
The EC27_SENC function set consists of three function groups:
Manual Updating
SENC Data Handling
SENC Data Protection
The group Manual Updating includes functions to manually update objects of the
SENC data. Existing objects can be annotated, marked as deleted, or new objects
can be inserted. The SENC cells themselves are not changed, and all manual
updates can be withdrawn again. See chapter 13 Manual Updating for more
information.
The functions of the group SENC Data Handling support a comfortable loading of
binary cells from the SENC database. High level functions which load all cells
covering a selected area with a specified "navigational purpose" or usage are
provided in this function set. This makes it possible to draw a seamless chart
image. See chapter 10.6 Loading ENCs for more information.
The group SENC Data Protection includes functions to encrypt and decrypt SENC
cells..
4.2.5 EC27_DENC
To simplify and accelerate the handling of ENCs SevenCs has developed a chart
management concept called directENC. The underlying idea is that prior to
distribution ENCs are converted into the SENC format of the ECDIS Kernel, so
that applications based on the Kernel can directly access the SENC files.
The EC27_DENC function set consists of three function groups:
directENC Agency Code Handling
directENC Data Handling
directENC Update Handling
The group directENC Agency Code Handling contains functions to access the
producing agency code catalogue, which is part of the ECDIS Kernel delivery.
This catalogue contains all IHO codes for the official data producers as well as all
registered codes of private data producers.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
4 Kernel Overview Page 17
The group directENC Data Handling contains functions to handle the loading,
symbolization and visualization of SENC files in a comfortable way.
The functions in the group directENC Update Handling are used to apply S-57
update messages to the SENC database as well as converting S-57 base files into
the SENC format. See chapter 11 directENC for more information.
4.2.7 EC27_Symbol
The SENC database contains pure geometry and abstract descriptions of chart
objects, or, in other words, the chart data are stored in the SENC independent of
the presentation. This means that it is the task of the ECDIS software to render a
chart display from these abstract data.
The EC27_Symbol function set consists of three function groups:
Chart Presentation
Mariner Settings
Symbology Procedures
These groups contain functions to display the SENC database contents. Drawing
instructions are created from the SENC by invoking the Presentation Library for
ECDIS. This Presentation Library contains symbols, line styles and fill pattern, as
well as colour definitions. As a result a display list is created which will be used
by functions of EC27_Draw. See chapter 10.7 Symbolization for more
information.
4.2.8 EC27_Draw
Since the chart data stored in the SENC are independent of the presentation, and
drawing instructions are created using the Presentation Library, the chart can be
displayed on several media using the EC27_Draw function set.
The EC27_Draw function set consists of three function groups:
Chart Drawing
Color Handling
Dynamic Object.
This function set contains functions that draw a bitmap from the vector data of the
SENC to the computer memory at high speed. From there it can be copied to the
display window.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 18 4 Kernel Overview
Because the chart image is created in the computer memory before it is copied to
the screen, double buffering is fully supported by the EC27_Draw function set.
These functions also support 8-bit graphics as well as true colour. See chapter
10.8 Drawing for more information.
4.2.9 EC27_Print
Even when using an ECDIS some situations call for paper charts. If, for example,
the positioning systems in the ECDIS are unavailable or an event shall be
recorded for evidence, it may be necessary to print a paper chart of the current
area of operation.
The functions in these groups differ in the operating system used as indicated by
their names.
On UNIX system charts can be printed from the Display List contents using the
function group Print X11. The Kernel function writes a Postscript image of the
bitmap or the window to the file associated with a file descriptor. The Image is
then scaled by a scale factor.
On Windows, the Kernel function on the group Print NT prints the contents of the
specified bitmap. The system's default printer selection box is used to specify the
printer settings
4.2.10 EC27_Globe
Most navigational systems determine the area of operation by evaluating the
sensor input but usually it is also necessary to select an area anywhere in the
world, e.g. to plan a route from Port A to B.
When determining a particular geographic area of operation it is helpful to have a
graphic globe display or a list of ports to choose from, instead of selecting a
particular chart from a list of file names.
With the functions of the function set EC27_Globe a globe with coastlines and
ports can be displayed on the computer monitor. This globe can be rotated and
areas and ports can be interactively selected. Charts of the selected area or the
surrounding area of the selected port can then be loaded into or deleted from the
SENC database.
The port database can also be realized as a list of locations. If a particular port is
selected the globe rotates to this location and the surrounding area can then be
chosen as the new chart focus. See chapter 15 The Globe for more information.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
4 Kernel Overview Page 19
4.2.11 EC27_Sensor
Crucial to ECDIS products is the ability to process input data from external
sensors such as GPS, LORAN-C, gyro, speed log and ARPA-radar.
This dynamic information can then be displayed with the charts, e.g. a ship
symbol indicating the current position. It can also be processed and used by
modules of other function sets, e.g. to realize a danger alert system in combination
with the function set EC27_Monitor.
The functions of the EC27_Sensor function set are used to read sensor
information from a serial port, communicating in the NMEA-0183 standard data
for-mat. They are designed to be used in independent processes, in order not to
slow down the interactions with the ECDIS user interface.
Any incoming sensor data about the state of the system, and information on
interactions between the user and the system must be recorded in order to meet the
ECDIS standards. This function set therefore also includes a group of functions
(Data Recording) to record the movement of the own ship from the sensors.
Information such as position, heading, and speed is written to a time-stamped log
file. These data can be played back from the file for analyzing vessel movements,
or for training purposes. See chapter 18 Sensor Data for more information.
4.2.12 EC27_Monitor
A basic requirement for navigational systems is the ability to monitor the ship's
movement and give an early warning of dangerous situations. The dynamic
information such as current position, course, and speed combined with the chart
data in the SENC is used to realize this functionality.
With the modules of this function set a danger alert system can be implemented.
A guard zone surrounding the ship can be defined and the SENC is then
frequently queried to search for obstacles located in this guard zone. It is also
possible to implement an alert system that warns the user when the ship is off the
planned route.
There are also functions available to realize the recording and display of a past
track, as well as calculating a short-term prediction of the ship's motion. See
chapter 17 Monitoring for more information.
4.2.13 EC27_Route
A navigational system must allow to plan different routes, select an appropriate
route which will be used, and check it for safety.
With the functions of the EC27_Route function set a user can interactively plan a
complex route network both as great circle and rhumb line by creating waypoints
and leg lines. A curved leg line can be defined by specifying a turning radius at a
waypoint. To select a route from the available route network, the user only needs
to specify the starting point or leg line, and the system automatically searches for
the next leg line or waypoint to compose a complete route. The user only needs to
mark the next leg line if it is ambiguous.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 20 4 Kernel Overview
The routes can be changed, stored, selected, and pre-checked to ensure safe
passage with regard to the chart information in the SENC. See chapter 16 Route
Handling for more information.
4.2.14 EC27_Tides
This function set provides functions to calculate tidal predictions. See chapter 14
Tidal Predictions for more information.
4.2.15 EC27_Navigation
To navigate a ship it is necessary to calculate positions and distances. With this
information it is possible for the user to plan a voyage or estimate the time of
arrival.
4.2.16 EC27_Admin
All functions necessary to initialize, register and configure the EC2007 ECDIS
Kernel are collected in the function set EC27_Admin. See chapter 19 Software
Registration for more information.
4.2.17 EC27_Easy
The function set EC27_Easy contains high level functions to give a simple start
on using the Kernel function library. For complex and flexible applications,
however, it is recommended to use the more flexible functions provided in the
other function sets.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
4 Kernel Overview Page 21
4.2.18 EC27_AIS
The AIS (Automatic Identification System) has been developed for the maritime
industry using the maritime VHF band for the transmission and reception of data
signals. See chapter 18.2 Library Interface for Communication with an AIS
4.2.19 EC27_DNC
In order to process DNC (Digital Nautical Chart) data a new function set has been
introduced. This new function set EC27_DNC includes rules and lookup tables for
the symbolization of DNC features, object and attribute dictionaries, and a special
DNC version of the danger dictionary dncdng.dic. See chapter 9.2 DNC and
VMAP Data for more information.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 22
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 23
5 How to Start
Linux / gcc
- Compiler Defines: -D_UNIX_SOURCE -D_LINUX_SOURCE
- Link with Library (Debug): libEcKernel512d.so
- Link with Library (Release): libEcKernel512.so
Solaris / gcc
- Compiler Defines: -D_UNIX_SOURCE -D_SOLARIS_SOURCE
- Link with Library (Debug): libEcKernel512d.so.5
- Link with Library (Release): libEcKernel512.so.5
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 24 5 How to Start
5.2.1 Readcat
This example reads the dictionary and writes some information about two
attributes on the screen.
First some background information:
The ‘dictionary’ consists of the object catalogue and the attribute catalogue (the
files are located in the directory .../lib/objcat) which together are usually
just called S-57 Object Dictionary (S-57 Object Catalogue). This dictionary
includes the description of the object classes and attributes.
For more information on the object structure and the specifications of the object
classes and attributes within the S-57 Object Dictionary see chapters
1.1 Summary: the Chapters in this Document and 7.2 Dictionary Access.
The example readcat only uses functions of the function group Dictionary
Access:
EcDictionaryReadModule()
EcDictionaryTranslateAttributeToken()
EcDictionaryGetAttributeCode()
EcDictionaryFree()
To get information about the object classes from the dictionary you must read the
files and, if no longer needed, free the allocated resources.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 25
EcDictInfo *dictinfo;
EcDictionaryFree(dictinfo);
Among other things, the attribute consists of a name, a token (a six character
abbreviation of the name), and an integer code. With the token of the attribute
given (DRVAL1), the example retrieves the full name and the code of this
attribute from the dictionary, and writes them on the screen:
UNIT16 codenumber;
char buffer[256];
if (Ec_DICT_OK == EcDictionaryTranslateAttributeToken
(dictinfo, "DRVAL1", buffer, sizeof(buffer)))
printf("DRVAL1: %s\n", buffer);
if (Ec_DICT_OK == EcDictionaryGetAttributeCode
(dictinfo, "DRVAL1", &codenumber))
printf("DRVAL1 code: %d\n", codenumber);
When programming with the EC2007 ECDIS Kernel it is usually not necessary to
extract specific information from the dictionary. However, generally there is a
need to read the dictionary because, as mentioned earlier, many functions handle
objects and therefore take a pointer to an object dictionary context as a parameter
(dictinfo in our example).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 26 5 How to Start
5.2.2 Readhead
This example reads some header information of a cell and writes it into a text file
named info.txt.
Before any header information can be accessed from a cell this cell must first be
mapped. This mapping is realized with the function EcCellMap(). This
function maps a cell file into memory until it is explicitly released by the function
EcCellUnmap().
The function is called with three parameters and returns the cell ID which is
needed in other functions, e.g. to visualize the cell content.
The first parameter is the full name of the cell file including the directory path and
the file extension.
The second parameter is the access mode in which the cell can be accessed. It can
be one of the following three variants:
EC_ACCESSREAD for read only access to the cell,
EC_ACCESSWRITE for read/write access to the cell, or
EC_ACCESSNOACCESS for no access to the cell.
Note:
One particular cell should be mapped with write access by only one
application or thread.
The access mode can also be changed after the cell has been mapped with the
functions EcCellAccessGet(), EcCellAccessSet(), or
EcCellAccessRelease().
The third and last parameter is a timeout in milliseconds for the access of the cell.
EcCellId cellid;
char *cellname;
cellname = "c:/usr/local/data/bin/7c3bd005.7cb";
if (cellid == EC_NOCELLID)
{
printf("Cannot map cell: %s\n", cellname);
exit(0);
}
…
EcCellUnmap(cellid);
After the cell has been mapped, the header information can be read. The function
EcCellGetHeaderInfo() retrieves specified information from the cell.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 27
This function is called with four parameters and returns a boolean value.
The first parameter is the cell ID from which the information is obtained, this cell
ID is returned by the EcCellMap() function.
The second parameter specifies the information you want to retrieve. It is of the
type ‘EcHeaderRequest’, and the ECDIS Kernel provides special constants
which can be used. For example EC_HDR_INTU to retrieve the intended usage of
the cell, EC_HDR_UADT for the update, and EC_HDR_URLAT to get the north
east latitude of the cell’s coverage. A complete list of all constants allowed as
parameters is given in chapter 8.1 Cell File Access
.
The third parameter is of the type caddr_t. It is a pointer to the returned value.
The last parameter is the size of the third parameter.
INT32 usage;
char upd_date[16];
EcCoordinate urlat;
All the functions used in the example Readhead are from the function group Cell
Access in the function set EC27_Vector. The example is called with one
parameter, the name of the cell file from which the header information is
obtained.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 28 5 How to Start
EcView *view;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 29
if (!EcChartAssignCellToView(view, cellid))
{
MessageBox(NULL, "Cannot assign cell to view",
"error showcell", MB_OK);
EcCellUnmap(cellid);
EcChartViewDelete(view);
exit(1);
}
…
EcChartUnAssignCellFromView(view, cellid);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 30 5 How to Start
Note:
In our example the parameter makeBitmaps is set to False which implies
that the bitmap and the device context / graphic context will be created by the
application.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 31
EC_NIGHT
HPALETTE hPal;
if (EcChartReadColors(view, NULL)==0)
{
MessageBox(NULL, "Cannot read color file", "error showcell",
MB_OK);
// error handling
}
if (!EcChartSymbolizeCell(view, cellid))
{
MessageBox(NULL, "Cannot symbolize chart", "error showcell",
MB_OK);
// error handling
}
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 32 5 How to Start
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
5 How to Start Page 33
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 34 5 How to Start
The following procedures are all operating system (Windows / UNIX) specific
and they will not be explained in detail here. At this point we simply summarize
the actions which are realized in our example.
For more details see the source code, and use the Microsoft Visual C++ help files
or man pages:
Define and register your own window class.
Calculate the size of the view window.
Implement a callback function for the main window.
Create and show the main window.
Enter the main message loop.
Free the resources.
Note:
Under Windows it is very important to handle the color palette correctly. In
the source code you can see how this is accomplished in our example by using
the WM_QUERYNEWPALETTE and WM_PALETTECHANGED messages.
In this example, functions with names starting with EcChart…() are from the
function group Chart Presentation in the function set EC27_Symbol.
Functions with names starting with the EcDraw…() are from the function set
Ec27_Draw.
The example is called with one parameter, the name of the cell to be drawn on the
screen.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
6 The SevenCs Data Model Page 35
S-57 is the transfer format for hydrographic data. Data provided in S-57 format
are called Electronic Navigational Chart (ENC) data. This format is not designed
to be used directly in an ECDIS application. Therefore, ECDIS software
producers import the S-57 format into a proprietary System Electronic
Navigational Chart (SENC) format that can be handled directly by their software.
The SevenCs SENC format called directENC (see Appendix for details) is based
on an object model that defines real world entities as a combination of descriptive
and spatial characteristics. Within this model these sets of characteristics are
defined in terms of feature objects and spatial objects where the spatial object
consists of a primitive classifying the geometry of the object, and a segment
carrying the geographic coordinates of the object. This data model gives the
directENC format a great flexibility and allows importing all data from different
data models and different formats.
The following figure shows the components of an object. The feature object is
described in more detail in chapter 7 The Object and Attribute Dictionary.
OBJECT
identifier,
attributes
is located by
FEATURE SPATIAL
1+
SEGMENT PRIMITIVE
is type of
related to:
1+ at least one
Components of an object:
Feature Object: This part of an object describes the characteristic of the
object (e.g. Buoy, Tower, Land area). More detailed
information is specified by the respective attributes.
Primitive: The primitive classifies the geometry of the object: if it is
an area, a line, a point, or a sounding cluster.
Segment: Segments are the parts a primitive consists of. Segments
can be of type edge or node. They carry the geographic
coordinates of an object.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 36 6 The SevenCs Data Model
As described above the spatial object is divided into a primitive part, and a
segment part. The purpose of a primitive is to serve as an easy to handle interface
between feature objects and often complex spatial structures.
There are four types of primitives: area, line, point, and point cluster. Figure 6.2
shows that all four primitive types relate to segments of type node or edge.
Segments encapsulate coordinates and attributes on coordinates like positional
accuracy. The figure also shows that segments can be linked to each other and to
primitives, but never directly to feature objects. Relationships from segments to
feature objects and vice versa are always indirect and must go via primitives.
The area primitive allows the grouping of edges to describe the inner and outer
boundaries of an area, i.e. it defines polygons by assembling sequences of
relationships to edges. Since the polygons must be closed, the respective edges
have to be oriented (forward or reverse), and must form a chain without gaps. The
area primitive is a very powerful construct, which enables the SevenCs model to
handle complex objects like depth areas comprised of hundreds of edges.
The line primitive allows the binding of edges to a chain, for example combining
several edges to realize a coastline that extends over many miles. A single feature
object containing the name of the coast, for example, can then be linked to the line
primitive to form a compact and complete object.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
6 The SevenCs Data Model Page 37
The point cluster primitive allows the grouping of a large amount of nodes that
contain depth information like soundings. The point cluster primitive provides an
efficient way to hold bulks of spot information. It is therefore often utilized to
hold survey data.
The point primitive can only hold the relation to a single node. Most feature
objects like buoys or towers are linked to a point primitive that in turn is linked to
a single node holding the location of the object.
The major advantage of the SevenCs model is its almost unlimited ability to
handle data of a complex structure. The primitives allow the grouping of segments
before they are linked to feature objects. In addition, objects can be comprised of
a feature object and more than one primitive of different type. For example, an
object of the class ‘berthing facility’ can consist of a feature object containing a
name, an area primitive representing the outline of the main jetty, and several
adjacent line primitives representing the location and generalized shape of the
gangplanks.
The following table shows which ECDIS Kernel version uses which SENC
version, and the compatibility between the SENC versions:
The SevenCs SENC format version 4.3 supports the directENC data protection
concept. This and the entire directENC concept are described in detail in chapter
11 directENC. However, ECDIS Kernel versions 4.8 and older cannot read the
new SENC format.
Note:
To import data that were compiled with Kernel 5.0 into an application that has
been compiled using Kernel version 4.8 or older it is required to convert the
data to S-57 first.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 38 6 The SevenCs Data Model
The EC2007 ECDIS Kernel versions 3.3 and higher perform an improved
calculation of the bounding boxes of objects which cross the dateline. Two
restrictions still apply:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 39
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 40 7 The Object and Attribute Dictionary
All object classes and attributes are listed in the S-57 Object Dictionary that is
also called the S-57 Object Catalogue. In order not to confuse this Object
Dictionary with the S-57 and SENC cell catalogues we will refer to it as the
Object Dictionary in this programming guide. A complete description of an object
class contains the name, the acronym, the code, and the allowed attributes
Set Attribute_A: CATACH; DATEND; DATSTA; NOBJNM; OBJNAM; PEREND; PERSTA; RESTRN; STATUS;
Set Attribute_B: INFORM; NINFOM; NTXTDS; SCAMAX; SCAMIN; TXTDSC;
Set Attribute_C: RECDAT; RECIND; SORDAT; SORIND;
Definition:
An area in which vessels anchor or may anchor. (IHO Dictionary, S-32, 5th Edition, 130)
References:
INT 1: IN 12.1-9;
M-4: 431.3;
Remarks:
Distinction: anchor berth; mooring/warping facility;
The Acronym of the object class is a six character token describing the object
class. The Code is a unique number identifying the object class or attribute. The
sets of attributes are divided as follows:
Attribute_A
contains attributes which define the individual characteristics of a certain
object.
Attribute_B
contains attributes which provide information relevant to the future use of the
data, e.g. for presentation or for an information system.
Attribute_C
contains attributes which provide administrative information about the object
and the data describing it.
The field References describes the references to the INT1 and M4 Chart
Specification.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 41
Attribute type: S
Definition:
References:
INT 1: ID 7, IF 19, IN 12.2-3;
M-4: 371; 323.1-2; 431.2-3; 431.5;
Remarks:
No remarks.
In addition to attribute name, acronym, and code the type of an attribute must be
specified. The following attribute types are available:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 42 7 The Object and Attribute Dictionary
Note:
For more information about the new dictionaries and a list of available options
and dictionaries see chapter 19.2.5 Module Registration.
If the dictionary context is no longer needed in the application its memory must be
freed with the function EcDictionaryFree(). This function takes a pointer
to the structure EcDictInfo as the only parameter.
EcDictInfo *dictinfo;
EcDictionaryFree(dictinfo);
If you want to create your own object classes and attributes, see chapter
7.3 Creating Object Classes and Attributes. In this case the function
EcDictionaryMergeExt() is used to read the new dictionary.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 43
EcDictInfo *myDictinfo;
…
Note:
In case duplicate object classes or attributes are encountered the function uses
the writeOver parameter to determine which information to take. If the
parameter is set to True the information from the added dictionary (i.e. from
the specified files) will be taken, if the parameter is set to False the
information from the existing dictionary context (dictInfo) will be taken. If
all dictionaries in our example had an object class 'EXAMPL' with different
descriptions the first call of the function EcDictionaryMergeExt()
would take the original description of the 'EXAMPL' class stored in
dictInfo, and the second call would store the description from
otherobjcat.dic in the new dictionary context myDictInfo.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 44 7 The Object and Attribute Dictionary
Each object class or attribute is defined by two keys, a numeric code and an
alphanumeric token of six characters length (acronym). The following functions
are used to retrieve related keys:
EcDictionaryGetObjectToken()
EcDictionaryGetAttributeToken()
EcDictionaryGetObjectCode()
EcDictionaryGetAttributeCode()
These two functions search the given dictionary context for the object class or
attribute specified by its numeric code, and then return its acronym in the
parameter token which is a variable of the structure EcClassToken or
EcAttributeToken respectively. The return value of these functions can be
EC_DICT_OK on success, EC_DICT_NOTFOUND if the specified object class or
attribute is not in the given dictionary or EC_DICT_ERROR on failure.
These two functions search the given dictionary context for the object class or
attribute specified by its acronym and then return its numeric code in the
parameter code. The return value of these functions can be EC_DICT_OK on
success, EC_DICT_NOTFOUND if the specified object class or attribute is not in
the given dictionary or EC_DICT_ERROR on failure.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 45
Since the object class or attribute acronyms have a length of only six characters it
is sometimes helpful to have the full name to identify the object class or attribute.
The functions EcDictionaryTranslateObjectToken() and
EcDictionaryTranslateAttributeToken() retrieve the full name of
the object class or attribute specified by its acronym, respectively. The parameters
are:
dictInfo pointer to the dictionary context
token given object class / attribute alphanumeric
token
buffer pointer to the result string
bufferlen size of buffer
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 46 7 The Object and Attribute Dictionary
The third parameter of this function specifies the filter conditions. The following
values can be used:
EC_DICT_FULL_MANDATORY for attributes mandatory for the given class
in any case,
EC_DICT_COND_MANDATORY for attributes mandatory under certain
circumstances,
EC_DICT_PROHIBITED for attributes prohibited for the given object class,
or any bit-wise combination of these values.
The memory for the returned list of attributes is allocated by this function and
must be freed by the application with the function EcFree(). The function
returns the number of attributes in the returned list on success, and 0 on failure.
EcDictInfo *dictInfo;
int num; // number of attributes
EcAttributeToken *attrList;
num = EcDictionaryGetObjectAttributes(dictInfo,"DEPARE",0,&attrList);
printf("Attributes of class DEPARE:\n”);
for (int i=0; i<num; i++)
{
printf("\t%s\n", attrList[i]);
}
if (num>0) EcFree(attrList);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 47
There are also functions to get the allowed geometry of an object class,
EcDictionaryGetObjectGeometry(), to get the default value for an
attribute of an object class, EcDictionaryGetDefaultAttributes(),
and to get the type (geo, meta, carto or collection, see chapter 1.1 Summary: the
Chapters in this Document) of an object class,
EcDictionaryGetKindOfObject().
Similar functions are also available for accessing information about attributes.
The function EcDictionaryGetKindOfAttribute() returns the type of
the given attribute, which can be either a feature, national feature, spatial or
cartographic attribute (see chapter 1.1 Summary: the Chapters in this Document).
The type of the attribute value can be retrieved with the function
EcDictionaryGetAttributeType(). The defines EC_ATTR_INT,
EC_ATTR_ENUM, EC_ATTR_FLOAT, EC_ATTR_LIST, EC_ATTR_ASCII,
and EC_ATTR_STRING are possible attribute value types returned by this
function.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 48 7 The Object and Attribute Dictionary
More information about attributes, like the maximum and minimum values, can
be retrieved with the functions EcDictionaryGetAttributeMaxValue()
and EcDictionaryGetAttributeMinValue().
The following example lists all enumeration values for a given attribute:
EcDictInfo *dictInfo;
EcAttributeToken *attr;
EcAttributeType *attrType;
double maxValue;
char buf[256];
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 49
Attribute values are stored in the data as ASCII strings. To convert them to a
numeric value the function EcDictionaryConvertAttribute() can be
used. The parameters are:
dictInfo pointer to the dictionary context
attrCode concatenation of attribute token and value
result pointer to the result (type see below)
This function converts the value of an attribute from string format to a numeric
value. The type of the result has to match the type of the attribute. The following
types are requested:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 50 7 The Object and Attribute Dictionary
7.3.1 Guidelines
Here are some principles which should be considered when designing a new
object class following the S-57 concept:
An object class definition should be complete, i.e. it should cover all aspects
of a real world entity that are of interest to your application. An object that
needs to be related to other objects in order to retrieve comprehensive
information will be complex to handle. For example, the name of a particular
object should be an attribute of the class rather than an object of its own.
A definition of an object class should represent an easy to comprehend
concept. It is better to create two separate object classes if the definition of
one object class is too lengthy and confusing. For example, separate the names
of the residents from the class 'captains recreation resort' and design a 'captain'
class with attributes 'first name' and 'last name' rather than incorporating a list
of residents in the 'resort' class. You can access the residents by later applying
relations between the 'resort' objects and the 'captain' objects.
Each attribute can only exist once in an object class definition and may only
contain one attribute value. For example, a light consisting of more than one
light sector is split into as many objects of this class as there are light sectors.
The attributes defining the sector limits may not be duplicate or contain more
than one value for a given object. The only exceptions to this rule are
attributes of the type 'List'. These attributes may contain a composite string
that can be broken down into a number of discrete values.
The value of one attribute must not influence the value of other attributes, thus
avoiding hierarchical dependencies within the attribute list of an object class.
For example, a topmark is not considered to be an attribute of a buoy but an
object of its own. Otherwise it would render the attribute values describing the
properties of the topmark dependant on an attribute value indicating the
presence of the topmark on the buoy.
Taking these guidelines into account we will start designing our first object class.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 51
As an example we will design a Recreation Resort for former Captains. The call
definition should be generic, i.e. like a blue-print which can be re-used several
times. We will therefore design an object class from which individual 'instances'
of a resort can be created.
Think of a name for your object class. It should describe the class without
containing any specific information restricting the reusability. In our example
the name for the object class will be 'Captains Recreation Resort'.
Create a six character acronym from the name of the class. The acronym must
be in lower-case letters since it is a non-standard object class. Only object
classes defined in S-57 are allowed to have upper-case acronyms. Also avoid
acronyms which are reserved for the standard. In our example the acronym is
‘crecrs’.
If you insist on having the acronym in upper-case letters, write to the
International Hydrographic Bureau in Monaco, 4 quai Antoine 1er, B.P.445,
MC98011, Monaco CEDEX, Principality of Monaco, for registration to the
standard.
Decide which geometry your objects (instances of the new class) shall have.
Will they be points, lines, or areas? For example our 'Captains Recreation
Resort' (crecrs) may have area geometry in large scale charts, or it can be a
point in a small scale chart.
Write a clear and easy to comprehend definition of your new class. Other
users will then be able to understand the meaning of your class, and use it as
well.
Each object class definition should have three subsets of attributes:
subset 'Attribute_A': Attributes in this subset define the individual
characteristics of a certain object.
subset 'Attribute_B': Attributes in this subset provide information relevant
to the future use of the data, e.g. for presentation or
for an information system.
subset 'Attribute_C': Attributes in this subset provide administrative
information about the object, and the data describing
it.
Important for creating a new object class is subset A. This is where your
collection of attributes that makes up the individuality of your new object
class is placed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 52 7 The Object and Attribute Dictionary
Usually you do not have to define attributes in subset B and C yourself. They
can be copied from one of the standard S-57 object classes. Almost all object
classes hold the same attributes in subset B and C.
If no standard attribute is appropriate you must define your own attribute.
Again, a name and a lower-case six character acronym must be created. Then
select an attribute type from the following list:
discrete value type: The expected input is a number selected from a list of
pre-defined attribute values. Exactly one value has to
be chosen. The abbreviation for this type is 'E' (for
'enumeration').
list value type: The expected input is a list of one or more numbers
selected from a list of pre-defined attribute values. If
you use more than one value they must be separated
by commas. The abbreviation for this type is 'L' (for
'list').
float data type: The expected input is a numeric value with a defined
range, resolution, unit, and format. This input is used
for numeric processing. The abbreviation for this type
is 'F' (for 'float number').
integer data type: The expected input is a numeric value with a defined
range, resolution, unit, and format. This input is used
for numeric processing. The abbreviation for this type
is 'I' (for 'integer number').
coded string type: The expected input is a string of ASCII characters in
a predefined format. The information is encoded by a
defined coding system e.g.: a nationality will be
encoded by a two character field specified by ISO
3166 'Codes for the Representation of Names of
Countries', e.g. Canada => 'CA' (Refer Annex E to
Part B). The abbreviation for this type is 'A' (for
'ASCII').
free text format type: The expected input is a free-format alphanumeric
string containing e.g. a last name, or a short textual
description. It may also be a file name which points
to a text file or graphic file. The abbreviation for this
type is 'S' (for 'string').
In order to decide which attributes your class should have it is useful to
analyze the characteristics of a typical object of this class. Questions like:
Does it have a name?; Can it have different states?; Can it be categorized like
an anchorage area for small crafts, explosives, or general use? are very
helpful.
Then browse the S-57 for already defined attributes that can be applied. For
example 'OBJNAM' is an attribute that is often adopted for homemade classes.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 53
Figure 7.1 and Figure 7.2 show a first design of our ‘Captains Recreation Resort’
object class and our attribute named ‘Pleasure Facilities’.
Code: crecrs
Definition:
An area where former captains can relax and enjoy life.
Remarks:
The entrance will be restricted to captains of our company.
Distinction:
Also see 'Mariners Widows Recreation Resort'
Expected input:
ID Meaning
1 : bar
2 : water skiing
3 : discotheque
4 : cinema
5 : casino
6 : massage
7 : tennis club
8 : golf course
Remarks:
The attribute 'Pleasure Facilities' encodes the various types of
activities that are provided by a 'Captains Recreation Resort'.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 54 7 The Object and Attribute Dictionary
Figure 7.3 and Figure 7.4 show the revised version of the class now called
‘Recreation Resort’ and a new attribute named ‘Category of Resorts’.
Code: recres
Definition:
A place where people go for relaxation or recreation.
Remarks:
The entrance will be restricted to members only.
Distinction:
None.
Expected input:
ID Meaning
1 : captains resort
2 : mariners widows resort
Remarks:
The attribute 'Category of Resorts' encodes the various types of
recreation resorts.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
7 The Object and Attribute Dictionary Page 55
In addition to making the class more general, the attribute ‘Pleasure Facilities’
must be made consistent. The expected input of this attribute calls for a particular
facility. However, the values 2 and 6, ‘water skiing’ and ‘massage’, are services
or activities. Changing them to ‘water skiing lane ‘ and ‘massage studio’ makes
the attribute consistent. Figure 7.5 shows this revised attribute definition.
Expected input:
ID Meaning
1 : bar
2 : water skiing lane
3 : discotheque
4 : cinema
5 : casino
6 : massage studio
7 : tennis club
8 : golf course
Remarks:
The attribute 'Pleasure Facilities' encodes the various types of
facilities that are provided by a 'Recreation Resort'.
Your class design will then be an object class private to your company. Nobody
outside your company will know about it. Always keep that in mind. You cannot
send an object of this class to other parties utilizing S-57 unless you send a
machine-readable dictionary containing your class definition, too. But for use in
ECDIS by your company it will be sufficient.
To make your own object class known or simply to find out if any new object
classes (non S-57 standard classes) are available which might fit your needs, you
can look at ‘The Object Class Registration Service’ of the OpenECDIS Forum
(http://www.openecdis.org). Here a machine-readable enhanced object catalogue
is provided. Among other things this catalogue includes all S-57 standard object
classes and attributes. The Object Catalogue is continuously being enhanced to
accommodate the changing requirements of ECDIS. The OpenECDIS also
provides a tool to easily create and register your own object classes.
To create objects of your new class (an instance of the class) the function
EcObjectCreate() can be used. This function and some more flexible
functions to create objects are described in chapter 8.3.1 Creating Objects
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 56
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 57
8 Data Access
The functions of the function group Cell Access of the set Ec27_Vector are used
to access the cell files. They are described in detail below.
As mentioned in chapter 6 The SevenCs Data Model the S-57 standard specifies
a transfer format for electronic navigational charts which is not suited for direct
data access. The SevenCs SENC format has been developed to ensure an efficient
data access. S-57 ENCs can be easily converted into the binary SENC format with
the respective ECDIS Kernel functions. All functions described here only access
files in the binary SENC format.
The access mode of a cell can be changed later in the application by means of the
two functions EcCellAccessSet() and EcCellAccessRelease(). In
multithreaded applications it is possible that several threads have read access to a
particular cell. However, if one thread has write access to a cell no other thread
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 58 8 Data Access
can have either write or read access to that cell. In these multithreaded
applications it is best to map the cell without access (EC_ACCESSNOACCESS).
Then set the appropriate access mode every time something is done with the cell,
and release the access mode directly after the operation. In order to give another
thread the chance to finish its operation, the EcCellAccessSet() function
should be called with a timeout value. This is particularly necessary if at least one
thread will access the cell for writing.
The function EcCellAccessSet() sets the access mode for a given cell. The
parameters are:
cid identifier of a mapped cell (as returned by
the function EcCellMap())
accessmode type of access (read, write or no access)
timeout timeout for setting the access
This function returns True if the requested access mode was successfully set for
the given cell, and False otherwise.
To find out what access mode is currently set for a particular cell the function
EcCellAccessGet() can be used. This function also takes the cell ID as only
parameter, and returns the current cell access mode. This can be one of the
following values:
EC_ACCESSREAD
EC_ACCESSWRITE
EC_ACCESSNOACCESS
Once the cell is mapped and the appropriate access has been set the information
contained in the cell can be read with the respective Kernel functions. To retrieve
information stored in the header of the cell the function
EcCellGetHeaderInfo() is used. The function takes the following
parameters:
cid identifier of a mapped cell (value is
returned by the function EcCellMap())
request specifies the header information to be
queried (see below)
value pointer to the returned value
buffsize size of value if the returned value is of type
char*
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 59
The defines which can be specified for the parameter request are listed below:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 60 8 Data Access
Note:
The parameter buffsize is only evaluated in case the requested data
information is of type char *.
The header information also contains the original S-57 file name
(EC_HDR_ONAME). However, this may be different from the current file name of
the cell in SENC binary format, e.g. the S-57 file name has the extension .000
and the corresponding cell file name has the extension .7CB. To retrieve the
current file name of a specific cell, as it is stored in the file system, the function
EcCellGetNameById() is used. This function takes the cell ID as only
parameter and returns a pointer to a static string containing the cell’s file name. If
an error occurs, the function returns NULL.
Note:
The returned pointer will be valid until the next call to
EcCellGetNameById().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 61
Deleting Cells
Just as you can create a new cell, there is also a function for deleting a cell. This
function is called EcCellDelete() and it removes the cell specified by its
name from the file system. The only parameter is the file name including path and
extension. Before deleting a cell from the file system it should be unmapped by
means of the function EcCellUnmap().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 62 8 Data Access
Note:
All handles to object components of this cell will become invalid after
reorganizing the cell with the function EcCellForceCleanup(). That is
why this function should not be called between any data operations on the cell.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 63
when no other object component is related to it, e.g. a feature object that has no
primitive or a primitive without any nodes or edges. To remove these orphaned
object components and fragments from the data structure without reorganizing the
cell the function EcCellRemoveOrphans() can be used. This function takes
the following parameters:
cid identifier of the cell
errlog open file handle for error messages
errorcount number of orphaned object components
found
If the file handle errlog is not NULL diagnostics are written to it. When calling
this function the handles to object components not yet deleted are still valid, and
further data operations can be performed on the cell.
A feature object is orphaned if it is neither linked to any primitives nor related to
other feature objects.
A primitive is orphaned if it is not linked to any feature objects or any segments.
A node is orphaned if it is neither linked to any non-orphaned point or cluster
primitives nor to any edges (in case of a bounding node).
An edge is orphaned if it is not linked to any non-orphaned line or area primitives.
This function checks the data structure of a cell by searching for distorted object
components and dangling pointers. The parameter errlog exists only for
backward compatibility. If this function returns False the cell is damaged. It can
no longer be used, and has to be rejected. This test is also done internally during
cell mapping, thus a cell with structural errors cannot be mapped.
Applications may call EcCellCheck() after a large number of complex cell
manipulations, like object create or delete operations.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 64 8 Data Access
The following example shows how the statistics on the total amount of all object
components, feature objects, primitives, nodes, and edges of a cell can be
implemented.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 65
EcCellUnmap(cellid);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 66 8 Data Access
Class Token
The class token specifies the class the feature object belongs to. This parameter
can be retrieved with the function EcFeatureGetClass(). This function
takes the following parameters:
feature handle of the feature object (of type
EcFeature)
dictinfo pointer to an object dictionary context as
returned by the function
EcDictionaryReadExt()
buffer character buffer for the class token
buflen length of buffer
This function returns True on success and False otherwise.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 67
Group
In S-57 each feature object belongs to a particular group. The possible group
values are 1 for skin of the earth objects, and 2 for all other objects. To retrieve
the group value a given feature object belongs to the function
EcFeatureGetGroup() is used. This function takes the handle of the feature
object as only parameter and returns the group value.
Identifiers
The parameters record ID and object ID are used to uniquely identify the feature
object. The record ID is mainly used for updating an S-57 cell in order to identify
the modified objects of the cell. The functions EcFeatureGetObjectId()
and EcFeatureGetRecId() are used to retrieve these identifiers of a given
feature object.
To find a particular feature inside a cell when one of the identifiers is given the
functions EcQueryFeatureByObjectId() and
EcQueryFeatureByRecId() can be used. These functions take the handle of
the starting feature object and the respective identifier (object ID or record ID) as
parameters, and return a handle of the corresponding feature object. The starting
feature object indicates at what point in the chained list of feature objects the
search is started. These functions perform a linear search on the list of feature
objects with linear time complexity.
Status
The status parameter is not part of the S-57 objects. This value is only evaluated
by the ECDIS Kernel functions. Possible values are:
EC_OS_DELETABLE
EC_OS_USERDEFINED
EC_OS_SYSTEMDEFINED
This parameter is set when creating your own feature objects (see chapter 8.3.1
Creating Objects for more details on creating objects).
To retrieve the status of a feature object the function
EcFeatureGetStatus() is used. This function takes a handle of the feature
object as only parameter and returns the feature object’s status.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 68 8 Data Access
Attribute List
The attribute list of each feature object contains all attribute tokens and their
corresponding values. These attributes can be retrieved one by one by means of
the function EcFeatureGetAttributes(). The parameters are:
feature handle of the feature object
dictinfo pointer to an object dictionary context
fi pointer to EcFindInfo type for storing the
iteration state
first flag that indicates first or subsequent calls
attrbuf character buffer for storing the attribute
token and value
buflen length of attrbuf
The parameter first should be EC_FIRST when calling the function for the
first time and EC_NEXT in all subsequent calls.
The result of this function is a combination of attribute token and attribute value
stored in the parameter attrbuf. The functions
EcDictionaryTranslateAttributeValue()and
EcDictionaryConvertAttribute() can be used to translate the attribute
value into human-readable text or convert it into a numeric value.
The function returns True on success and False if no more attributes exist for
the given feature object.
Note:
No attributes must be inserted into or removed from the feature object between
the calls of EcFeatureGetAttributes().
To find out whether a given attribute is included in the attribute list of a feature
object the function EcFeatureQueryAttribute() is used. The attribute is
specified by its token, and the combination of attribute token and attribute value is
returned. The function takes the following parameters:
feature handle of the feature object
dictinfo pointer to an object dictionary context
attrtoken given attribute token
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 69
The next example shows how to count all feature objects of class depth area with
the attribute DRVAL1 = 10.00 m of a given cell.
Note:
Only attributes with the exact value 10.00 will be found. It is also possible to
use the function EcDictionaryConvertAttribute(), thus converting
the value to perform a numeric comparison.
The same result can be achieved with the high level function
EcQuerySpotCell(). This function retrieves feature objects of a given cell
filtered by the specified class and attributes. The parameters are:
cellid identifier of a mapped cell
dictinfo pointer to an object dictionary context
classname given class token
attrstr given attribute tokens and values
delimiter delimiter used in attrstr
fi pointer to EcFindInfo type for storing
the iteration state
first flag that indicates first or subsequent calls
lat latitude of object
long longitude of object
This function returns a handle of a feature object. The returned object position
(parameters lat, long) is a representative position.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 70 8 Data Access
char attrbuf[42];
EcCellId cellid;
EcDictInfo *dictInfo;
EcFeature featureObj;
int counter;
counter = 0;
// free dictionaries
EcDictionaryFree(dinctInfo);
// unmap cell
EcCellUnmap(cellid);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 71
Note:
This function allocates memory to the two lists objList and relList,
which must be freed by the application using the function EcFree().
If there are no related feature objects (return value 0), the parameters objList
and relList are undefined.
Each of the parameters objList and relList may also be NULL, in which
case no memory is allocated to the list. This also means that if both parameters are
NULL the function only returns the number of relations.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 72 8 Data Access
Relation to Primitives
The description of the SevenCs data model in chapter 6 The SevenCs Data
Model shows that an object not only consists of a feature object but also of a
spatial object. The feature object is the describing part which includes the main
attributes and which is connected to the spatial part through a link to a primitive.
Since this connection is mandatory for geographic objects it is always possible to
retrieve information about the primitives of an object by means of the feature
object. The collection objects mentioned above do not have a geographic position,
therefore they are not linked to any primitives. They are, however, always related
to other feature objects.
Note:
This function allocates memory to the three lists primList, sminList, and
smaxList, which must be freed by the application using the function
EcFree().
If there are no primitives linked to the feature object (return value 0), the
parameters primList, sminList, and relList are undefined.
Each of the parameters primList, sminList, and relList may also be
NULL, in which case no memory is allocated to the list. This also means that if all
three parameters are NULL the function only returns the number of relations.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 73
EXAMPLE:
In the following example all primitives are retrieved one by one from each feature
object of a given cell. The class name of each feature object and the types of its
related primitives are printed.
Note:
The S-57 data model (see chapter 9 Other Vector and Raster Data) does not
include the primitive layer. During the conversion of S-57 data into the
SevenCs SENC format one primitive is added for each geographic S-57
object. This indicates that all S-57 objects have exactly one primitive and that
only user-defined objects may have more than one primitive.
For example, the past track object known in the ECDIS Kernel has a line primitive
for the track itself and a cluster primitive (EC_S_PRIM) for the time tags on the
track.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 74 8 Data Access
EcCellId cellid;
EcDictInfo *dictInfo;
EcFindInfo fi;
EcFeature featureObj;
EcPrimitive primitive;
EcPrimitiveType primType;
INT32 scamin, scamax;
char Oclass[42];
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 75
Primitive:
record id
status
type
relation to feature objects
list of segments (nodes or edges)
Note:
For S-57 objects the record ID of the primitive is logically linked to the record
ID of the corresponding feature object for line and area primitives, or to the
record ID of the corresponding nodes for point or cluster primitives.
Type
The type of a primitive holds the information about the geometry of an object.
The following values are possible for this parameter:
EC_P_PRIM for point primitives
EC_S_PRIM for cluster primitives (mainly used for soundings)
EC_L_PRIM for line primitives
EC_A_PRIM for area primitives
The function EcPrimitiveGetType() is used to retrieve the type of a given
primitive. This function takes a handle of the primitive as only parameter, and
returns the primitive type. If an error occurs the return value will be -1.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 76 8 Data Access
Note:
This function allocates memory to the list of feature objects fList which
must be freed by the application using the function EcFree().
The parameter fList may also be NULL, in which case no memory is allocated
for the list of features, and only the number of relations is returned.
List of Segments
The third component of a complete object is the segment. Each primitive, as part
of an object, is linked to at least one segment. Depending on the primitive type
these segments are either nodes or edges. Point primitives are linked to exactly
one node, cluster primitives, e.g. soundings, are linked to more than one node, and
line and area primitives are linked to one or more edges.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 77
Note:
This function allocates memory to the list of nodes nodeList which must be
freed by the application using the function EcFree().
Note:
This function allocates memory to the three lists edgeList, orntList, and
usagList which must be freed by the application using the function
EcFree().
In case there are no edges linked to the primitive (return value 0), the parameters
edgeList, orntList, and usagList are undefined.
Each of these parameters may also be NULL, in which case no memory is
allocated to the list. This also means that if all three are NULL the function only
returns the number of relations.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 78 8 Data Access
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 79
EXAMPLE:
In the following example all primitives of a given cell are retrieved from the
chained list of primitives, and depending on the primitive type the number of
nodes or edges is printed for each primitive.
EcCellId cellid;
EcPrimitive primitive;
EcPrimitiveType primType;
int numNodes, numEdges;
if(primType==EC_S_PRIM)
fprintf(stdout,”primitive of type sounding has ”);
else
fprintf(stdout,”primitive of type point has ”);
fprintf(stdout,”%d nodes.”,numNodes);
}//if
if((primType==EC_L_PRIM)||(primType==EC_A_PRIM))
{
// get number of edges linked to primitive
numEdges = EcPrimitiveGetAllEdges(primitive,NULL,NULL,NULL);
if(primType==EC_A_PRIM)
fprintf(stdout,”primitive of type area has ”);
else
fprintf(stdout,”primitive of type line has ”);
fprintf(stdout,”%d edges.”,numEdges);
}//if
// get next primitive of the cell
primitive = EcPrimitiveGetNext(primitive);
}// while
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 80 8 Data Access
Node:
record ID
status
type
position
depth
dimension
attribute list
relation to primitives
Type
The type of a node can be either EC_ISOLATED or EC_BOUNDING. A bounding
node is always related to an edge and describes its first or last vertex. These
bounding nodes are usually not referenced by any primitives unless an additional
object, e.g. a buoy marking an anchorage area, is located at that position.
The isolated nodes are always related to at least one point or cluster primitive.
The function EcNodeGetType() is used to retrieve the type of a given node.
This function takes a handle of the node as only parameter, and returns the node
type. If an error has occurred the return value will be -1.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 81
Note:
Only isolated nodes may be three-dimensional, i.e. have a depth value,
whereas bounding nodes are always two-dimensional.
To retrieve the position, dimension, and possible depth value of a node the
function EcNodeGetPosition() is used. This function takes the following
parameters:
node handle of the node
latitude latitude of position in decimal degrees
longitude longitude of position in decimal degrees
depth value of third dimension in meters
(undefined if ndim = 2)
ndim dimension of node (2 or 3)
This function returns True on success and False otherwise.
Attribute List
The attribute list of each node contains all attribute tokens and their corresponding
values. These attributes can be retrieved one by one by means of the function
EcNodeGetAttributes(). The parameters are:
node handle of the node
dictinfo pointer to an object dictionary context
fi pointer to EcFindInfo type for storing
the iteration state
first flag that indicates first or subsequent calls
attrbuf character buffer for storing the attribute
token and value
buflen length of attrbuf
Note:
The parameter first should be EC_FIRST when calling the function for the
first time, and EC_NEXT in all subsequent calls.
The result of this function is a combination of attribute token and attribute value
stored in the parameter attrbuf.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 82 8 Data Access
Note:
No attributes may be inserted into or removed from the node between the calls
of EcNodeGetAttributes().
In S-57 there are currently only two attributes that are available for spatial objects
(nodes and edges): positional accuracy (POSACC), and quality of position
(QUALPOS).
EXAMPLE:
In the following example for all nodes of a given cell their type, position, depth (if
existing), and all their attributes are printed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 83
EcCellId cellid;
EcDictInfo *dictInfo;
EcFindInfo fi;
EcNode node;
EcNodeType nodeType;
EcCoordinates lat, long;
int ndim;
double depth;
char attrbuf[256],buffer[256];
Bool result;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 84 8 Data Access
Relation to Primitives
As mentioned above each isolated node is linked to at least one primitive of the
type point or cluster, and a bounding node may be linked to a point primitive.
Note:
This function allocates memory to the list primList, which must be freed by
the application using the function EcFree().
In case there are no primitives linked to the node (return value 0) the parameter
primList is undefined. The parameter primList may also be NULL in which
case no memory is allocated to the list, and the function only returns the number
of relations.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 85
Edge:
record ID
status
type
dimension
number of vertices
vertex list
attribute list
relation to primitives
relation to nodes (bounding nodes)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 86 8 Data Access
Note:
The function allocates memory to the list of vertices which must be freed by
the application with the function EcFree().
To extract the coordinates of each vertex of the array of vertices returned by the
function EcEdgeGetPosition() the number of vertices in that array and the
dimension of each vertex are needed. To retrieve the dimension of the vertices the
function EcEdgeGetDimension() is used. This function also takes a handle
of the edge as only parameter and returns the dimension of the vertices.
EXAMPLE:
In the following example the coordinates (latitude and longitude) of all vertices of
each edge of a given cell are printed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 87
EcCellId cellid;
EcEdge edge;
EcCoordinates *vertexList, lat, long;
int numVertices, dim;
Note:
This function allocates memory to the array coor which must be freed by the
application using the function EcFree().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 88 8 Data Access
Attribute List
Analogous to the nodes an edge can also have an attribute list containing all
attribute tokens and their corresponding values. These attributes can be retrieved
one by one by means of the function EcEdgeGetAttributes(). This
function is used in the same way as the function EcNodeGetAttributes()
described above. In addition there is a function available to check whether a
particular attribute is included in the attribute list of a given edge. The function
EcEdgeQueryAttribute() for edges is analogous to the function
EcNodeQueryAttribute() for nodes.
Relation to Primitives
Each edge is linked to at least one primitive of the type line or area. To retrieve all
primitives of a given edge the function EcEdgeGetAllPrimitives() is
used. This function returns all primitives linked to the given edge in a list of
primitives. The parameters are:
edge handle of the edge
primList list of all linked primitives
The return value of this function is the number of linked primitives. If an error
occurs the return value is -1.
Note:
This function allocates memory to the list primList which must be freed by
the application using the function EcFree().
In case there are no primitives linked to the edge (return value 0), the parameter
primList is undefined. The parameter primList may also be NULL, in which
case no memory is allocated to the list, and the function only returns the number
of relations.
To retrieve the primitives related to the given edge one by one the function
EcEdgeGetPrimitive() can be used. The parameters are:
edge handle of the edge
fi pointer to EcFindInfo type for storing the
iteration state
first flag that indicates first or subsequent calls
This function returns a handle of the related primitive which can be of type
EC_L_PRIM or EC_A_PRIM. An empty handle is returned if no more related
primitives exist or an error has occurred.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 89
Note:
When creating a new object in a particular cell, or deleting or modifying
objects in a cell, this cell must be mapped with write access.
To create a complete object as feature object at least one primitive, and at least
one node or edge must be created and then linked together.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 90 8 Data Access
Now that a new feature object and a primitive exist the relation between these two
components must be created. To link a primitive to a feature object the function
EcPrimitiveLinkToFeature() is used. This function takes the following
parameters:
feature handle of the feature object
primitive handle of the primitive
scamin minimum display scale for primitive
scamax maximum display scale for primitive
This function returns True on success and False otherwise.
For a complete object at least one spatial component node or edge is still required.
The functions EcNodeCreate() and EcEdgeCreate() are used to create a
new node or edge respectively. The function EcNodeCreate() takes the
following parameters:
cellid identifier of a mapped cell
lat latitude of position in decimal degrees
long longitude of position in decimal degrees
depth value of third dimension in meters
(not used if ndim = 2)
ndim dimension of node (2 or 3)
This function returns the handle of the newly created node.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 91
Note:
If you set the parameter mask to EC_MASK_HIDE the given edge will not be
drawn for all feature objects linked to the given primitive.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 92 8 Data Access
Note:
If the specified value for the parameter where is greater than or equal to the
number of edges in the segment list the edge will be added at the end of the
segment list.
There is also a high level function for creating a complete object. This function is
called EcObjectCreate() and has the following restrictions:
exactly one feature object, one primitive and one segment are created
no cluster objects can be created
only two-dimensional coordinates are accepted
when creating an area object the last coordinate has to coincide with the first
coordinate
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 93
Note:
Only objects which have the EC_OS_DELETABLE flag set in the status may
be deleted.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 94 8 Data Access
EXAMPLE:
The following example shows how to select the new method of deleting object
components for a given cell.
EcCellId cellid;
EcFeature feature;
EcNode node;
EcDeletedObject dObj;
// set the delete mode to completely remove objects from the cell
EcCellSetDeleteMode(cellid, EC_DELOBJ_FULL);
// delete a node of the cell, it will be completely removed
EcNodeDelete(node);
// unmap cell
EcCellUnmap(cellid);
// when mapping the same cell again, the delete mode will be the default value,
// deleting objects completely, but the list of deleted object is not changed.
When using the EC_DELOBJ_TOLIST delete method the list of deleted objects
is filled. All the deleted object components are of type EcDeletedObject, and
the following information is stored:
Deleted Object:
former component type (see EcDeletedObjectType definition below for
possible values)
class token (only for former feature objects)
group (only for former feature objects)
object id (only for former feature objects)
record ID (for all types)
status (for all types)
attribute list (only for former feature objects, nodes or edges)
wide character attribute list (only for former feature objects)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 95
typedef enum
{
EC_DELOBJ_NOOBJECT = 0, (error)
EC_DELOBJ_FEATURE, (feature object)
EC_DELOBJ_P_PRIM, (point primitive)
EC_DELOBJ_S_PRIM, (sounding cluster primitive)
EC_DELOBJ_L_PRIM, (line primitive)
EC_DELOBJ_A_PRIM, (area primitive)
EC_DELOBJ_B_NODE, (bounding node)
EC_DELOBJ_2D_NODE, (isolated node 2 dimensional)
EC_DELOBJ_3D_NODE, (isolated node 3 dimensional)
EC_DELOBJ_EDGE (edge)
} EcDeletedObjectType;
Note:
No relations to other components are stored in this list of deleted objects.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 96 8 Data Access
EXAMPLE:
In the following example the number of deleted objects is determined by
retrieving each component one by one, and the result is then compared with the
value returned by the function EcDeletedObjectGetNumber().
EcCellId cellid;
EcDeletedObject dObj;
int i,j;
if (i >= 0)
{
j=0;
// get the first deleted object of the cell
dObj = EcDeletedObjectGetFirst(cellid);
while (ECOK(dObj))
{
++j;
// get the next deleted object of the cell
dObj = EcDeletedObjectGetNext(dObj);
}// while
if (i==j)
printf(“OK: %d objects in delete list.\n”, i);
else
printf(“Something is wrong with this cell.\n”);
}// if
// unmap cell (see example above)
When retrieving the stored information about any deleted object it is usually
important to know of what type the deleted object is. The function
EcDeletedObjectGetType() is used to determine the type of a deleted
object component. This function takes a handle of the deleted object as only
parameter and returns its type. The return value of this function is of type
EcDeletedObjectType. Its possible values are described above.
For all deleted objects the identifiers and the status can be obtained. Depending on
the type of the deleted object the following functions can be used to retrieve the
corresponding information:
EcDeletedObjectGetRecId() to retrieve the record ID
EcDeletedObjectGetStatus() to retrieve the status
For former feature objects, nodes, and edges the attributes can be retrieved one by
one with the function EcDeletedObjectGetAttributes(). It is also
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 97
In addition to the information mentioned above the following data can be obtained
for former feature objects:
EcDeletedObjectGetObjectId() to retrieve the deleted
feature object’s ID.
EcDeletedObjectGetClass() to retrieve the class that
the deleted feature object
was derived from.
EcDeletedObjectGetGroup() to retrieve the group that
the deleted object belongs
to.
EcDeletedObjectGetAttributesW() to retrieve wide character
attributes one by one.
EcDeletedObjectQueryAttributeW() to search for a particular
wide character attribute.
EXAMPLE:
In the following example for all deleted feature objects of a given cell their
attributes and their object IDs are retrieved.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 98 8 Data Access
EcCellId cellid;
EcDictInfo *dictInfo;
EcFindInfo fi;
EcFeatureObjectId objId;
EcDeletedObject dObj;
EcDeletedObjectType dObjType;
char buffer[512];
Bool result;
Bool first = EC_FIRST;
int i,j;
To permanently remove all information about the deleted objects from the cell a
cleanup has to be done. The function EcCellForceCleanUp() is described in
detail in chapter 8.1 Cell File Access. Besides removing all deleted objects and
reorganizing the cell by means of this function it is also possible to completely
remove single deleted object components from the list of deleted objects. The
function EcDeletedObjectShred() is used to remove an element from the
list of deleted objects of a given cell. This function takes the handle of the deleted
object that is to be completely removed as only parameter and returns True on
success and False otherwise.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page 99
Note:
Changing the record ID of S-57 objects will make updating these data
impossible.
Each function takes a handle of the respective object component and the new
record ID as parameter. The record ID is of type UINT32, and the functions
return True on success and False otherwise.
The status of an object component is also not needed for the display or query. This
parameter can be used to store additional information. The following functions are
used to set or change the status of an object component:
EcFeatureSetStatus()
EcPrimitiveSetStatus()
EcNodeSetStatus()
EcEdgeSetStatus()
Each function takes a handle of the respective object component and the status as
parameters. The status is of type EcStatus, which can have the following
values: EC_OS_DELETABLE, EC_OS_USERDEFINED,
EC_OS_SYSTEMDEFINED, or a bit-wise (or-) combination of these values. The
functions return True on success and False otherwise.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 100 8 Data Access
Before an object can be deleted its status must be set to include the
EL_OS_DELETABLE flag.
In addition the following functions are available only for feature objects:
EcFeatureSetObjectId()
This function sets or changes the object ID which is used in S-57 to relate feature
objects.
Note:
Changing the object ID may result in the object ID no longer being unique.
The function takes a handle of the feature object and the new object ID as
parameters. The object ID is of type EcFeatureObjectId and returns True
on success and False otherwise.
EcFeatureSetClass()
This function is used to change the class the feature object is derived from. When
creating a new feature object the class must be specified, so this function is used
to change the class of an already existing feature object. The function
EcFeatureSetClass() takes the following parameters:
feature handle of the feature object
dictinfo pointer to an object dictionary context
classname object class token
Note:
When changing the class of a feature object the attributes also must be
changed to correspond with the new class.
Note:
Changing the group value of an S-57 object may result in the cell data
becoming inconsistent.
The areas inside a cell which contain data must be completely covered by group 1
objects which may not overlap. The function takes a handle of the feature object
and the new group value as parameters. The group value is of type UINT32 and
has to be within the range 0-255. The function returns True on success and
False otherwise.
For nodes the type is of importance. It is set or changed with the function
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page101
EcNodeSetType(). This function takes a handle of the node and the new type
as parameters. The type is EcNodeType, which can have the following values:
EC_ISOLATED_NODE or EC_BOUNDING_NODE. The function returns True
on success and False otherwise.
Attributes
For feature objects and segments (nodes and edges) there are functions available
for setting attributes. With the following functions new attributes can be added to
the already existing list of attributes of a feature object or a segment. If any of the
specified attributes already exist in the current list of attributes their values will be
overwritten.
EcFeatureSetAttributes()
EcNodeSetAttributes()
EcEdgeSetAttributes()
All these functions are very similar. They have the following parameters:
handle handle of the feature object, node or edge
dictinfo pointer to an object dictionary context
attrstr attribute string
delimiter delimiter used in attrstr
The parameter attrstr consists of a sequence of attribute tokens and attribute
values, which are separated by the delimiter specified in the fourth parameter.
Tip:
We recommend to use ‘|’ (ASCII 124) as delimiter because it is seldom used
in names, text or numeric expressions.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 102 8 Data Access
The following functions remove a single attribute from the list of attributes of a
given feature object, node or edge:
EcFeatureRemoveAttribute()
EcNodeRemoveAttribute()
EcEdgeRemoveAttribute()
The parameters are:
handle handle of the feature object, node or edge
dictinfo pointer to an object dictionary context
attrtoken attribute token
The attribute that is to be deleted is specified by its token, and the functions return
True on success and False otherwise.
The following functions completely remove the entire list of attributes of the
given feature object, node or edge:
EcFeatureRemoveAllAttributes()
EcNodeRemoveAllAttributes()
EcEdgeRemoveAllAttributes()
These functions take a handle of the respective feature object, node or edge as
only parameter, and return True on success and False otherwise.
Geographic Position
The geographic position of an object is solely stored in its segments. When
creating a new node or edge the geographic position is set. To alter this position
the following functions can be used:
Note:
If the position of a bounding node is changed the corresponding vertex
positions of the related edges will be automatically changed as well.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page103
The geographic position of an edge is specified by the list of vertices, where each
vertex has at least a latitude and longitude coordinate. When creating a new edge
a list of vertices must be specified. To make changes in this list the following
functions can be used:
EcEdgeAppendVertex()
EcEdgeInsertVertex()
EcEdgeRemoveVertex()
With the function EcEdgeAppendVertex() a new vertex can be added to the
end of the vertex list. This function takes a handle of the edge and an array of
coordinates as parameters. The coordinates are of type EcCoordinate, and the
amount of elements in the array depends on the dimension of the vertices in the
vertex list. However, the first two coordinates are always latitude and longitude of
the vertex.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 104 8 Data Access
Relations
When creating a complete object the relations between the different object
components must be specified, too.(see chapter 8.3.1 Creating Objects).
However, a relation that is not mentioned in that chapter is the relation between
two feature objects. The function EcFeatureRelate() is used to create a
specified type of relation between two feature objects. The parameters are:
feature1 handle of the original feature object
relation type of relation
feature2 handle of the related feature object
The relation is of type EcFeatureRelation and may have the following
values:
EC_MASTER_OF or EC_SLAVE_OF,
EC_BELONGS_TO or EC_HAS_A,
EC_CONSISTS_OF or EC_IS_PART_OF,
EC_HAS_MEMBER or EC_IS_MEMBER_OF,
EC_IS_RELATED_TO
The function returns True on success and False otherwise.
Also described in chapter 8.3.1 are the two functions available to append and
insert an edge into the edge list of a primitive,
EcEdgeAppendToPrimitive() and EcEdgeInsertToPrimitive().
To remove the relation to one of the edges the function
EcEdgeRemoveFromPrimitive() is used. This function takes the handle of
the primitive and the index of the edge in the edge list as parameters. The index 0
indicates the first edge in the edge list.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
8 Data Access Page105
All relations mentioned above are bi-directional. For example, if there is relation
between a node and a primitive it is possible to retrieve the related primitive if the
node is given, and to retrieve the related node if the primitive is given. When
calling any of these functions which remove a relation both directions will be
removed.
A special relation between object components is the relation between an edge and
a bounding node. This relation only exists in one direction, coming from the edge,
i.e. it is not possible to retrieve the edge a given bounding node is related to. The
function that creates such a relation is called EcEdgeSetBoundingNode().
The parameters are:
edge handle of the edge
ori first or last bounding node
node handle of the node
The parameter ori specifies whether the given bounding node is the beginning or
end bounding node of the edge. The values are EC_FORWARD for the beginning
and EC_REVERSE for the end bounding node. To remove a bounding node the
function is called with an empty node handle.
Note:
This function implicitly modifies the first or last vertex of the edge’s vertex
list. If an existing bounding node is replaced the position of the respective
vertex will change accordingly, if a new node is set a vertex will be appended,
and if a bounding node is removed the corresponding vertex will be removed s
well.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 106 9 Other Vector and Raster Data
OBJECT
is type of
identifier,
attributes
related to:
1+ at least one
An S-57 electronic navigational chart is also called a cell, which has a defined
geographical coverage and navigational purpose or usage.
Note:
Data of cells of the same usage must not overlap in order to enable a
continuous chart display.
The chart data in S-57 format usually is digitized from a paper or raster chart, or
may be created directly from survey data and object databases.
The purpose of this standard is to provide a digital replacement for the office
paper charts, which are allowed to be used for navigation.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 107
VECTOR
1+ bounds
NODE EDGE FACE
coordinates coordinates 1+ is adjacent to
1+ 1+
terminates
ISOLATED CONNECTED
NODE NODE 1,2
is contained in
To solve these problems SevenCs has installed a data concept and data service for
its customers. This includes at first a full coverage overview data set in S-57
Ed.3.x format. There will be no more gaps even if no detailed data are available.
Next, SevenCs offers to produce, enhance or polish customer data to guarantee
good performance and an appealing display.
If you want to know more about the SevenCs data service call the SevenCs
Hotline!
Note:
The function set EC27_DNC is used to process DNC and VMAP data. Thus,
whenever in the following text DNC is mentioned the functions described can
be applied to both DNC and VMAP data.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 108 9 Other Vector and Raster Data
The function set EC27_DNC includes rules and lookup tables for the
symbolization of DNC features. DNC functionality was first introduced in Kernel
version 4.8. At that time the DNC presentation library was still under
construction, and a lot of improvements and modifications have been
implemented ever since. Therefore DNC Libraries and Lookup Tables had to be
modified. This implies that DNC data that were read and converted into SevenCs’
proprietary SENC format with Kernel version 4.8 must be converted again with
the current Kernel version.
DNC is only one of NIMA’s VPF (Vector Product Format) products, each of
which have certain specifications. For the symbolization of VPF data a special
standard called “Geospatial Symbols for Digital Displays” (GeoSym) was
developed. GeoSym 4 complies with Special Publication No. 52 of the IHO.
Although GeoSym 4 is not implemented with the EC2007 ECDIS Kernel DNC
data can be displayed according to GeoSym 4.
To read and display DNC data dedicated object and attribute dictionaries and
dedicated lookup tables are used. A special DNC version of the danger dictionary
(dncdng.dic) is provided, too.
To use DNC data with the Kernel these data must first be imported into the SENC
database. This is achieved with the functions of the new function set as described
below. Then the view must be set to use the DNC dictionaries and lookup tables
which is done with the standard Kernel functions EcDictionaryRead() and
EcChartSetLookupTable().
For anti-grounding or route checking the special DNC danger catalogue
dncdng.dic must be loaded and used with
EcMonitorCheckGuardZone(), EcRouteCheck() or
EcQueryIsObjectDangerous().
Once the DNC data have been imported into the SENC database all ECDIS
Kernel functions can be used as usual to access the data.
Note:
We recommend to keep S-57 and DNC data separated from each other and not
use them together.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 109
Note:
The DNC features and attributes are not converted into S-57 objects by
EcDNCReadTile().
The DNC coding is stored in the SENC without changes. Software that explicitly
handles S-57 objects or that expects certain S-57 objects to be present in a SENC
should be changed to work with the corresponding DNC features or to give a
warning if working on DNC based SENCs.
Due to the modifications and enhancements of the DNC function set mentioned
above some new functions have been implemented. Basically these functions
were introduced to retrieve general information about the VPF library or
particular DNC tiles. Some other functions have been modified.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 110 9 Other Vector and Raster Data
Note:
It is important that the binary patches must be applied to the respective
original base data set and not to versions of the data sets to which previous
patches have already been applied.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 111
In detail the following new functions are provided in the EC2007 ECDIS Kernel
to cover VDU functionality.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 112 9 Other Vector and Raster Data
Please note that this is an example for the Windows operating system. In this case
the patch software consists of two files:
Patch.exe
Patchw32.dll
Both files should be in the same directory.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 113
The following example shows how the conversion process has to be started after
applying a library patch. To do this the library must have been opened before.
...
/* Do the conversion */
EcDNCReadTiles(lib, di, tiles, tnum, sencPath, NULL, MyProgress);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 114 9 Other Vector and Raster Data
In the last example the access to the VDU update layer is documented.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 115
Note:
Without this documentation you will not be able to implement a S-63 interface
successfully.
You will also need to get your own "Manufacturer Key" and "Manufacturer ID".
You may need to sign an OEM contract with IHO before you can obtain these
items. Contact IHO at
www.iho.int or www.iho-ohi.net
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 116 9 Other Vector and Raster Data
9.3.2 Hardware ID
The S-63 security interface requires a 5 byte unique hardware ID. You should be
able to generate this ID by means of a dongle. For information on the hardware ID
format have a look at the S-63 specifications.
The SENC cells that result from the import of encrypted ENCs must be copy-
protected, i.e. they must be used only on the machine on which they were
imported. This can be achieved with the Kernel function
EcCellSetProtectionLocal().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 117
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 118 9 Other Vector and Raster Data
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 119
If the encrypted file contains an update, the decrypted file will be stored for
further processing. This is a "high level" function that has been introduced to
minimize the efforts of reading encrypted ENCs. Internally, it calls the listed
sequence of "low level" functions:
EcS63DecryptCellPermit() to decrypt the required cell permit.
EcS63DecryptENC() to decrypt the ENC cell.
EcS57GetCRC() to get the file CRC and compare it with the given CRC.
The following steps are executed only in case the ENC is a base cell (file
extension ".000"):
EcCellCreate() to create a new SENC cell.
EcCellMap() to map the new SENC cell.
EcS57V3ReadFileExt() to convert the ENC to SENC.
EcCellSetProtectionLocal() to mark the SENC as copy-protected.
EcCellUnmap() to unmap the SENC cell.
Delete the decrypted ENC cell
The core routines are included in a set of separate DLLs, whereas the Kernel
provides an interface compatible with other function sets.
Note:
The core DLLs are currently available only for Windows (Win32). On Unix
systems, the EcBSB...() functions will return error codes.
Before BSB charts can be used the core DLL mtsdk.dll must be loaded by
calling EcBSBInitialize(). This function tries to locate the DLL in the
specified search path. If this fails, subsequent calls to other EcBSB…() functions
will also fail. When the BSB functions are no longer used EcBSBEnd() should
be called to unload the DLL and free internal resources. The core DLLs are
available from SevenCs on request.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 120 9 Other Vector and Raster Data
A BSB raster chart consists of a number of separate files. The file names
correspond to the chart number, whereas the file extensions differ according to the
content.
EcBSBLoadChart() loads the specified BSB chart. The parameter fName
must specify the .KAP file of the chart. If the chart is going to be displayed, the
parameter mode must be set to eOpenAllInfo.
If only information about the chart is going to be queried the parameter mode
may be set to eOpenQuick. This will cause the chart to be loaded faster.
If the function EcBSBLoadChart() returns a negative value the chart could not
be loaded. If it returns a positive value the chart could be loaded but the user
should be informed by displaying the warning message returned by
EcBSBGetLastError().
Once a chart has been loaded, geographic coordinates can be transformed into
screen coordinates and vice versa by using one or more of the following
functions:
EcBSBImageToLatLon()
EcBSBXyToLatLon()
EcBSBImageToWGS84()
EcBSBXyToWGS84()
EcBSBLatLonToImage()
EcBSBLatLonToXy()
EcBSBWGS84ToImage()
EcBSBWGS84ToXy()
EcBSBGetWGS84Shift()
Each BSB chart contains at least one default colour palette. However, other
palettes may exist to support night-time viewing of the chart.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
9 Other Vector and Raster Data Page 121
Two functions are available for chart drawing. One of them returns the unscaled
image, whereas the other allows scaling of the chart.
EcBSBGetChartImage() draws the currently loaded chart into the
specified destination device context. The device context must have a
sufficiently large DDB selected beforehand. If chartColors is set to NULL
the default palette of the chart will be used. Otherwise the colours from the
specified palette structure will be deployed. The chart is drawn unscaled, i.e.
one image pixel will correspond to one pixel in the destination device context.
EcBSBDrawChart() draws the currently loaded chart into the specified
destination device context. The device context must have a sufficiently large
DDB selected beforehand. If chartColors is set to NULL the default
palette of the chart will be used. Otherwise the colours from the specified
palette structure will be deployed. The chart is centered on the specified
geographic position and scaled to the specified height of the destination
rectangle. If range is set to less or equal 0 the chart will be drawn unscaled,
i.e. one image pixel will correspond to one pixel in the destination device
context.
Information on the loaded chart can be retrieved by either using the following
high level functions or by evaluating the members of the structure
EcBSBChartInfo.
EcBSBGetImageSize() returns the horizontal and vertical image size of the
currently loaded chart.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 122 9 Other Vector and Raster Data
To facilitate finding a specific chart from the list of all installed charts catalogue
functions are provided that support administration and search.
The function allocates memory to the return array. If the returned number of
entries in the array is greater 0 the application must release the memory by calling
EcFree().
EcBSBSetImageCache() enables caching of the chart image. The cache
needs several megabytes of memory, therefore it is disabled by default.
Note:
BSB functions are not thread-safe. If more than one BSB chart must be used at
a time the same thread should carry out all the chart handling.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 123
10 Visualization
The following figure illustrates the structure of the view concept. The different
components shown here are explained briefly in the following sections with a
reference to the chapters where they are described in detail.
Viewport
Rotation
Settings
Drawing Engine Color
Table
Range
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 124 10 Visualization
Cell Cache: contains the Cell Entries that are no longer needed for the
current chart display (see chapter 10.6.5)
Viewport: defines the area on the earth's surface to be displayed on
the screen (see chapter 10.4)
Mariners Settings: option that influences the appearance of the chart display
and can be changed by the user of the ECDIS (see chapter
10.7.2)
Presentation Library: contains the information for the presentation of every
object class (see chapter 10.7.3)
Before calling one of these functions the view must be created and initialized with
the function EcChartViewCreate(). The parameters are:
dict a pointer to the dictionary structure as
returned by the function
EcDictionaryReadModule().
resolution information about the screen resolution
This implies that the dictionary must be read before a view is created, and should
only be released after the view has been deleted. It also should not be changed as
long as the view exists. The dictionary is needed in the view to access the Lookup
Tables correctly, and to avoid inconsistencies during the symbolization.
For the screen resolution the following defines are available:
EC_RESOLUTION_HIGH
EC_RESOLUTION_MEDIUM
EC_RESOLUTION_LOW
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 125
Note:
The value EC_RESOLUTION_HIGH should be used in case the screen
resolution is greater than or equal to 1280 x 1024 pixels.
EC_RESOLUTION_MEDIUM is appropriate for screen resolutions between
1280 x 1024 and 1024 x 768 pixels. EC_RESOLUTION_LOW is intended for
resolutions of 800 x 600 or 640 x 480 pixels.
Note:
The current ECDIS Kernel version only supports copying pick information.
Using this function is potentially dangerous. We strongly recommend setting
the view parameters with the standard functions.
All functions that use a view are able to write error messages into a special log
file. This log file can be passed to the view with the function
EcChartSetErrorLog(). With this function the logging of error messages
can be turned off again, too. Initially the error log is turned off when creating a
view.
The first two steps are performed in preparation for the two following steps which
represent the actual visualization process.
The following flow chart shows the ECDIS Kernel function needed to perform the
basic steps of the visualization process.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 126 10 Visualization
Need
No to change
the m ariner
Changing a display parameter
settings?
empties the cell cache and
m arks all display lists in the c ell list
as invalid. This, in turn, causes
Yes EcChartSymbolizeView()
to re-symbolize all cells in the
c ell list.
Yes
Set new display
parameters
No Need to
pan or
zoom?
Yes
EcChartLoadViewByArea()
If the display parameters have
not c hanged,
EcChartSybolizeView()only
builds the display lists for those
cells that have been newly
loaded to the cell list
EcChartSymbolizeView()
EcDrawNT/X11DrawView()
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 127
This procedure saves a lot of CPU cycles, and the chart picture will be drawn
much faster. However, there are some potential risks, too: If the contents of a cell
are edited while the buffer is enabled, e.g. a node is moved to a different location,
these changes will not be displayed correctly because the projection buffer still
holds the old coordinates.
Note:
When a cell is going to be edited, the buffer should be disabled.
A good example is a cell which contains the past track of a ship. Whenever the
ship moves, a position is added to the past track. In that case, the projection buffer
should not be enabled for the view the cell concerned is assigned to.
It is good practice to have one view for all static (read-only) cells with the
projection buffer enabled, and one separate view for the dynamic (read-write)
cells with the buffer disabled.
To find out the status of the projection buffer in a specified view you can use the
function ECDrawGetProjectionBuffer().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 128 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 129
Tip:
It is recommended to set the loadMode to EC_LOAD_COVERAGE.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 130 10 Visualization
One of the important features of an ECDIS is a continuous chart display while the
user moves the view area or changes the display scales by zooming in or out. The
aim is to fill the entire screen with chart data leaving no blank areas. In ECDIS
applications this is realized with a chart loading concept which is mainly based on
the usage or navigational purpose of the ENCs.
The S-57 standard classifies digital charts into six different types of usage,
according to their use. The usage of a chart depends on the scale of its source, and
it is the responsibility of the data producer to set the correct usage for each chart.
The six types of usage are:
Berthing with most details; best detailed usage
Harbour
Approach
Coastal
General
Overview least detailed usage
Most ECDIS user interfaces allow a selection of the chart display by range, not by
chart usage. This makes it necessary to define a relation between range or display
scale and the chart usage.
Like the traditional radar ranges, display ranges define the radius of a circular
view around the center of the screen. The diameter of the view covers the vertical
extent of the rectangular chart display (see Figure 10.3).
The display scale is calculated from the range. Depending on the used screen size
ranges result in different display scales.
The calculated display scale is usually an odd number, which is again normalized
to fit into a list of standard scales. The value from the list of standard scales that is
equal or greater than the calculated display scale is used as the normalized display
scale (see). ). The ECDIS Kernel provides functions to determine the scale from a
given range, EcDrawRangeToScale(), and to normalize a given scale,
EcDrawNormalizeScale(). See the function reference for more details on
these functions.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 131
Figure 10.4: Relation between display scale, standard scale, and chart usage
The chart loading concept takes a selected range, calculates the corresponding
display scale (e.g. 1:287,156), normalizes the scale (e.g. 1:350,000), and then
determines the appropriate usage (e.g. Approach) to be loaded. With this usage
the cells which cover the chart view can be identified. The corner coordinates of
the chart view are calculated from the center of the view, its vertical and
horizontal extent, and the standard display scale. The result is an area of the
earth's surface which is to be displayed on the screen.
The chart catalogue of the ECDIS software contains copies of the coverage
objects of all available cells. From this catalogue the cells are selected that
partially or completely cover the area, and are of usage equal to or less detailed
than the determined usage.
The names of the selected cells are included in a preliminary list of charts to be
displayed. This list contains charts of various usage types but not of usage more
detailed than the determined usage.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 132 10 Visualization
From this preliminary list the cells to be loaded are determined. The selection is
realized by first placing a virtual web, i.e. a grid, on the chart window of the
earth's surface. At each intersection point of this grid the chart with the best usage
covering that geographical position is selected from the preliminary list. All charts
in the resulting list are loaded into memory from which they can be drawn on the
ECDIS screen. This selection process is part of the functions
EcChartLoadViewByAreaExt() and EcDENCLoadViewByAreaExt().
As stated above internally a virtual web is used to determine the cells required to
cover the viewport. The width and height of the web’s meshes are specified by the
parameters meshWidth and meshHeight. Cells which are smaller (in terms of
screen size) than the meshes may be missed by the algorithm.
Note:
If an application needs to load a large amount of comparatively small cells,
e.g. if there are no larger cells available for that specific area, a smaller mesh
width and height should be defined.
Figure 10.5 shows an example of a preliminary chart list and the selection of the
charts that are actually loaded into memory.
The usage that has been determined from the selected range is Harbour. Therefore
cells of usage Berthing are not included in the preliminary list. When stepping
through the intersection points of the grid, chart A of usage General will never be
selected because there is always a chart of more detailed usage covering the
geographical position. Chart E of usage Coastal will not be included in the list
either since chart F of usage Approach covers its entire area. As a result the charts
B, C, D, F, and G will be loaded into memory.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 133
Note:
These functions allocate memory to the array of display list entries. This
memory must be freed by calling
EcDrawReleaseDisplayListEntries().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 134 10 Visualization
Cell Entries that are no longer needed for the current chart display. The latter Cell
Entries are kept inside the Cell Cache in case they might be needed for a
subsequent chart display. This has the advantage that these cells need not be
symbolized again because their Display Lists are still available. These two
containers are disjoint, which means that the Cell Entry of a particular cell cannot
be located in both containers at the same time.
After having selected the list of cells to be loaded into memory as described in the
previous chapter the following steps are taken for each cell in this list:
it is checked whether a Cell Entry for the cell already exists inside the Cell
List. If so, the cell has already been needed for the creation of the previous
chart display. The Cell Entry will stay in the Cell List. If not …
it is checked whether a Cell Entry for the cell is located in the Cell Cache.
If so, this entry is moved from the Cell Cache to the Cell List, including the
Display List, so this cell will not have to be symbolized again. If not …
a new Cell Entry is created in the Cell List. The Display List of this entry is
still empty since the cell has not yet been symbolized. The creation of such a
Cell Entry also includes the mapping of the corresponding cell.
In the end all Cell Entries in the Cell List that are not needed for the current
chart display will be moved to the Cell Cache.
In contrast to the Cell List, the Cell Cache has a limited capacity. When the Cell
Cache limits have been reached the oldest Cell Entry will be removed from the
Cell Cache. This also results in the corresponding cell being unmapped.
If one of the parameters that influence the symbolization (see chapter 10.7.2
Mariner’s Settings) is changed the Display Lists of all cells will become invalid,
even those kept in the Cell Cache. The purpose of the Cell Cache is to store the
Display Lists of cells in order to reuse them in a later chart display. In case all
Display Lists are invalid the Cell Cache will be completely emptied.
To take advantage of the Cell Cache the function EcChartSymbolizeView()
must be used to symbolize the cells in the view.
If this function is called with the parameter symbolForce set to False only
the cells that do not have a valid Display List will be symbolized.
If this function is called with the parameter symbolForce set to True all cells
loaded in the view will be symbolized. As a result the Cell Cache will be flushed
because the Display Lists stored there are no longer valid.
The function EcChartUnloadView() also empties the Cell Cache just like the
function EcChartFlushCellCache().
The following example shows the functions that must be called to take advantage
of the Cell Cache. It shows a sub-function to draw a chart for the operating system
UNIX (X-Window specific function calls).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 135
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <X11/Xlib.h>
#include "eckernel.h"
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 136 10 Visualization
EcChartLoadViewByArea()
Yes
Is this cell in
the cell list?
A cell entry holds The c ell cache is
pointers to the automatically
cell and its emptied if the
display list No display settings are
altered
Move the
respec tive c ell Yes Is this c ell
entry from the cell in the cell
c ache to the c ache?
cell list
No
1) Map this c ell to m emory
2) Assign this cell to the given view by
inserting a new cell entry to the cell list
No
Yes More
c ell
entries?
No
Return
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 137
Tip:
This function should be used to clean up a view before deleting it.
10.7 Symbolization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 138 10 Visualization
Basically the Display List Generator is a program loop that retrieves objects one
by one from a cell database. Since the cell does not contain information about the
colour of its objects or which symbol is to be used, the symbolization must be
derived from the object description.
Thus the object's attribute values are used to search for the appropriate
symbolization instruction within the lookup tables. In some cases the instruction
found in the lookup table is a call to a conditional symbolization procedure. These
procedures contain a decision process that interprets the object's attributes and
geometry to generate symbolization instructions.
At this point symbolization instructions for the display of the objects are available
regardless of whether they came directly from the lookup table or were generated
by a symbolization procedure.
These symbolization instructions are then interpreted and converted into a set of
system specific graphic commands that are stored in a Display List.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 139
Each graphic command in the Display List is assigned to the display priority that
also has been previously retrieved from the lookup table. The display priorities are
defined according to the requirements of the IMO and IHO.
After all objects have been examined by the program loop, the Display List is
filled with graphic commands. These commands are then performed by the
ECDIS graphics engine that in turn loads symbols from the symbol library, and
gets the color values from the color tables.
This concept to generate a chart display gives the ECDIS user, or mariner, full
control over the content and the appearance of the presentation:
if he selects e.g. another safety contour, the Display List will be renewed in
the programmed loop, and the blue shades of DEPARE (depth area) objects
will be changed by a symbolization procedure depending on the value of
minimum depth; or
symbolization instructions which refer to the traditional symbol set will be
replaced by instructions which refer to the simplified symbol set by switching
to another lookup table; or
the generation of the Display List will be influenced by a filter suppressing
text commands; or
the color values for the daytime will be replaced with those for the night time
by selecting another color table.
To symbolize all cells that are assigned to a particular view the function
EcChartSymbolizeView() can be used. The parameters are:
view pointer to view structure
symbolForce flag to force the symbolization of all cells
The second parameter indicates whether all cells shall be symbolized (True) or
only those cells that do not have a valid Display List (False). A cell must be
symbolized in case
it has not been symbolized before, i.e. no Display List exists for the cell
the Mariners Settings which influence the chart display have been changed
(see chapter 10.7.2 Mariner’s Settings)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 140 10 Visualization
the highlight status has been changed for one or more objects in the cell
objects have been added to or deleted from the cell
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 141
EcChartSymbolizeView()
Is there a
display list for
this cell?
No
The display lists of all cells
are marked invalid if a
Yes display setting suc h as
safety depth or display
category is changed by
the mariner
Is the
display list
No valid?
More
cell entries
Yes in the cell
list?
No
Return
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 142 10 Visualization
The EC2007 ECDIS Kernel provides a function to switch the status of the viewing
group or an interval of viewing groups to on or off. The respective objects will
then be added to or removed from the display. There is also a function available to
query the status of a single viewing group or interval of viewing groups.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 143
The IMO Performance Standard for ECDIS describes the content of the three
different display categories as follows:
Display Base:
This safety-relevant information must permanently remain on the ECDIS
display and may not be removed from it.
Standard Display:
This category contains all information of Display Base plus additional
navigational information. Information of this category should be displayed
when the chart is first shown by ECDIS.
All other information:
This category contains all information of the SENC database.
Note:
As a precaution, the function EcChartSetViewClass() internally sets
DISPLAYBASE to on if STANDARD is switched on, and sets both
DISPLAYBASE and STANDARD to on if OTHER is switched on. This
functionality ensures that applications are programmed according to the IMO
specifications.
Note:
The SevenCs view classes are mapped to intervals of viewing groups. The
IMO performance standard does not allow you to remove the presentation of
objects that belong to DISPLAYBASE (although this is possible by invoking
EcChartSetViewingGroup()!). Therefore the user interface has to
prevent the user or mariner from switching off viewing groups that are in the
display category DISPLAYBASE.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 144 10 Visualization
The past track can be visualized by displaying the special past track object. The
following functions are used for this purpose:
EcChartSetShowPastTrack() switches viewing groups 42410, 42430,
42440, 42460 on/off
EcChartGetShowPastTrack() gets the status of viewing groups 42410,
42430, 42440, 42460
The cross track limits define a corridor around the legs of a route in which a
vessel is considered to be on track. Usually the legs of a route are displayed as
lines because displaying the areas that are defined by the cross track limits could
overload the chart display or might cover important objects in the vicinity of the
route. The following functions are used to control the visualization of the cross
track limits. When the visualization is switched on the areas defined by the cross
track limits are drawn in a transparent color on top of the legs of the route.
EcChartSetShowCrossTrackLimits() switches viewing group 42212
on/off
EcChartGetShowCrossTrackLimits() gets the status of viewing group
42212
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 145
During the night it may be difficult to distinguish the colors of the deep and
shallow water areas. To emphasize the shallow water area it is possible to cover it
with a diamond shaped pattern. The following functions are used to make this
pattern visible:
EcChartSetShowShallowPattern() switches viewing group 23010
on/off
EcChartGetShowShallowPattern() gets the status of viewing group
23010
Each cell has a defined compilation scale depending on the resolution of the
source data. The compilation scale indicates the largest scale allowed to display
the chart in order to use it for navigation. It is the optimum scale at which data are
displayed completely and all information is legible. The value of the compilation
scale can either be stored in meta objects M_CSCL or as header information of
the cell.
If available these meta objects will be used to determine whether a so-called
overscale pattern shall be displayed, depending on the current display scale.
If no meta objects are available the compilation scale value stored in the cell
header is checked against the current display scale. The following functions are
used to control the display of the overscale pattern:
EcChartSetShowOverScale() switches viewing group 11030 on/off
EcChartGetShowOverScale() gets the status of viewing group 11030
The information about the quality of the data inside a cell is stored in the meta
objects M_QUAL. When visualizing these objects a pattern is drawn on top of the
cell. This pattern is defined in the Presentation Library and indicates different
quality levels for the data. The following functions are used to display or hide the
meta objects M_QUAL of a cell:
EcChartSetShowQualityInformation() switches viewing group
31010 on/off
EcChartGetShowQualityInformation() gets the status of viewing
group 31010
Some feature objects of a cell may have additional information stored in the
attribute INFORM. To indicate that additional information is available for a
particular object a special information symbol can be displayed at the object’s
position. To control the display of the information points inside a cell the
following functions can be used:
EcChartSetShowInformPoints() switches viewing group 31030 on/off
EcChartGetShowInformPoints() gets the status of viewing group
31030
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 146 10 Visualization
In special applications other than ECDIS, e.g. a map editor, the following
functions can be used to experiment with priority layers (0-99):
EcChartSetLayerVisible() switches a display priority layer on/off
EcChartGetLayerVisible() gets the status of a display priority layer
A cell may be displayed at a scale which is not detailed enough for safe
navigation. In that case an overscale pattern is displayed on top of the cell
concerned. However, the display of the overscale pattern can be suppressed, too.
EcChartSetShowOverscale() suppresses the display of the overscale
pattern
EcChartGetShowOverscale() shows whether the display of the overscale
pattern is currently enabled
The PRESLIB also classifies text as 'important' (groups 0-9) and 'non-important'
(groups 10-99). Important text should always be visible together with its object,
whereas non-important text is allowed to be switched off. The next two functions
were designed to handle such non-important text:
EcChartSetShowText() switches non-important text labels on/off
EcChartGetShowText() gets the status of non-important text labels
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 147
Deep contour:
This contour has the same function as the shallow contour except for the deep-
water area. The value of the deep contour must be greater than the value of
safety contour.
When setting these values it is recommended to keep the following relation:
Shallow < Safety < Deep contour,
otherwise the chart image may have a strange appearance.
Depth Contours are now labelled if the display of text labels is enabled.
The three depth contours described above separate the complete water area into
four areas of different depth ranges, which are displayed in four different color
shades. However, the most important differentiation lies in the shallow and deep
water areas, which is why it is also possible to display the entire water area in
only two color shades, one for the shallow and one for the deep water area.
The following functions allow the water area to be displayed in two or four-color
shades:
EcChartSetShowTwoShades() switches two color shade display on/off
EcChartGetShowTwoShades() gets the status of the color shades
The figure on the next page shows a chart in four-color (top) and two-color
(bottom) shading.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 148 10 Visualization
four shades
two shades
// depth correction
depthFactor = 1.0;
depthOffset = 0.0;
depthUnit = use ENC units;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 149
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 150 10 Visualization
For an ECDIS display S-52 requires a safety contour to enable the mariner to
clearly realize the dividing line between safe and unsafe waters. To have this
facility easily generated by the Presentation Library the DBWG (Data Base
Working Group) has introduced into S-57 the concept of linear depth areas.
In the meantime it has become apparent that the use of linear depth areas to
support the generation of safety contours has posed a number of problems to the
data producers, and a number of illogical data objects had to be created merely for
display purposes.
These objects are an unnecessary data overhead. If they could be avoided the
volume of ENC data could be reduced, and performance could be improved. After
all, these objects are carrying redundancies because the information is also stored
in adjacent areas.
From our experience with data sets manufactured by various producing agencies
we receive the impression that sometimes the number of linear depth areas is
larger than the number of depth areas of the geometric type area. Displaying those
data sets shows that the safety contour is not always continuous.
Following the general rule that the Presentation Library should display as much
information as possible using the basic data SevenCs has developed a method to
build the safety contour only from area objects.
The definition of the safety contour is the border between areas which are safe and
areas which are not. In any ENC, the area covered by data must be completely
filled with group 1 (skin of the earth) objects. These objects must not overlap, that
is why the areas have to share the linear geometry of the cell. The only areas
which are safe are Depth Areas (DEPARE) and Dredged Areas (DRGARE), all
other objects in group 1 have to be assumed as unsafe.
The criteria by which DEPARE or DRGARE objects are safe or unsafe are still
used in the current Conditional Symbology Procedure to obtain the fill color.
These criteria should remain unchanged.
In terms of set theory the safety contour is a set SC of the edges built by the
intersection of the set S containing all edges referenced by the safe group 1
objects, and the set U containing all edges used by the unsafe group 1 objects.
SC = S ∩ U
The method described creates a continuous safety contour. The quality of the
safety contour does no longer depend on the existence of linear objects but on the
error-free topology of the skin of the earth layer in the ENC data sets. This is
precisely defined in the standard and can easily be checked during quality
assurance procedures.
The new method also works when linear depth areas still exist in the data. Thus
S-52 can already be amended before the linear depth areas are (hopefully)
removed from S-57.
One must keep in mind that the safety contour is a mere display feature and does
not affect the creation of e.g. anti-grounding alarms. These alarms are fully
operational even without linear depth areas.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 151
10.7.2.6 Soundings
Soundings are measured water depths or spots which have been reduced to a
vertical datum.
According to the IMO performance standards the chart presentation on the display
also depends on the safety values that are set by the mariner. The safety depth
influences the presentation of soundings and obstructions. Soundings with depth
values greater than the safety depth are regarded as deep soundings, and
soundings with values smaller than the safety depth are regarded as shallow
soundings.
Note:
By default the soundings are only shown in the display category “All other
information” (view class EC_OTHER).
To visualize the soundings on the display the following functions can be used:
EcChartGetShowShallowSounding() retrieves the status of viewing
group 33012, 33010
EcChartSetShowShallowSounding() switches viewing group 33012,
33010 on/off
EcChartGetShowDeepSounding() retrieves the status of viewing
group 33014, 33010
EcChartSetShowDeepSounding() switches viewing group 33014,
33010 on/off
The function EcChartSetDepthCorrection() may be used to set the
correction factor and offset used for the display of features containing depth
information (e.g. depth areas, spot soundings, obstructions). The depth
information of those features is modified by the formula
correctedDepth = (originalDepth * correctionFactor) + correctionOffset
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 152 10 Visualization
This formula is used within the conditional symbology procedures which handle
the features carrying depth information. This means that only the presentation of
these features will change if correction values are given.
Note:
The actual data will not change, i.e. depth attributes of features and 3rd
coordinates of nodes will remain unchanged. The application must take care of
this in case depth information shall be presented in a pick report, since the
Kernel functions returning feature information (e.g. EcQueryPickAll())
will return the uncorrected depth values!
The default values are 1.0 for the factor and 0.0 for the offset, so the depth
information remains unchanged after the above formula has been applied.
The highlighting can be switched off by passing the parameter False to the
function EcChartHighLightObject() for each highlighted object in a
given cell. It is, however, also possible to switch off the highlighting of all objects
in a given cell at once by means of the function
EcChartAllHighLightOff().
As mentioned above the highlighting of an object is realized by the highlight
instructions. For a given cell there can be different symbolization instructions for
point, line, and area objects. To define these highlight instructions the function
EcChartSetHighlightInstruction() is used. The parameters are:
view pointer to view structure
dictInfo not used
primtyp type of primitive (EC_A_PRIM,
EC_L_PRIM or EC_P_PRIM)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 153
See chapter 10.7.3 The Presentation Library and the Presentation Library
document for a description of the instruction format.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 154 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 155
varying color and thickness. Complex line styles are composed of repeating line
patterns. They are used to satisfy the presentation according to INT1.
The complex line styles are stored in the directory
$LIB_7CS/lib/preslib4/lin/.
The Presentation Library also offers various ways to fill areas. They can be filled
with an opaque color, with a color showing some transparency or with a pattern of
symbols (fill pattern). Fill patterns are introduced as a solution for the
symbolization of areas in special situations, e.g. to symbolize the traffic direction
by using an arrow symbol in the traditional (paper chart) symbolization. This
forces the arrow symbol to be displayed as long as any part of the traffic
separation lane can be seen on the screen because a fill pattern showing arrows
does not have a certain position on the chart like the paper chart arrow symbol.
This handles the problem of the arrow symbol moving out of the screen when
changing the selected viewport.
The fill patterns are stored in the directory $LIB_7CS/lib/preslib4/pat/,
and distinguished by the screen resolution in the subdirectories rah, ram, and
ral.
10.7.3.2 Colors
The Presentation Library uses a color model which classifies colors by their
usage. Each color is represented by a token, a five character code which reflects
its usage, e.g. CHMGD for „chart magenta, dominant“. All color tokens are listed in
color tables with their coordinates in the CIE chromaticity diagram. For use on a
standard monitor the CIE coordinates have to be transformed into red-green-blue
(RGB) color values. The manufacturer of an ECDIS also has to provide for the
calibration of the CRT and the correct transformation from CIE to RGB. Symbols,
fill patterns, and line styles refer to the color tables by using the standardized
color tokens as part of the symbol definition.
The EC2007 ECDIS Kernel uses a color definition derived from the S-52 color
definitions. The RGB values of this definition are calculated by using a default
transformation. If a non-calibrated screen is used, which will be true in most
cases, this table generates an adequate color display for electronic charts.
However, there may be some differences to the colors on a calibrated screen. The
file with all color definitions is called SP52COL.DAT, and is located in the
directory $LIB_7CS/lib/preslib4/colour/.
There are five color schemes that were designed for different conditions of
illumination on the bridge of the vessels:
EC_DAY_BRIGHT
EC_DAY_WHITEBACK
EC_DAY_BLACKBACK
EC_DUSK
EC_NIGHT
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 156 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 157
Library.
The 'show complex line style' command word LC() takes the name of the line
style as parameter, e.g. LC(ACHARE51) shows the line style defined for
borders of anchorage areas.
instruction for area objects:
The 'color fill' command word AC() takes the following parameters: the fill
color indicated by a color token and an area transparency (optional) which can
be a value between 0 and 3 with 0 = opaque as default value and 3 = 75%
transparency.
The 'pattern fill' command word AP() takes the following parameters: the
pattern symbol name and the pattern symbol rotation (optional).
instruction for text labels:
The 'show text' command word is divided into purely alphabetic text TX()
and alphanumeric text TE(). They take the following parameters: the text
string, horizontal and vertical justification, the character spacing and
specification, x- and y-offset, text color, and the text grouping.
See the S-52 standard for more details.
instruction to call a conditional symbology procedure (rules):
The CS() command word takes the symbology procedure name as a pa-
rameter. The procedure is named after the object class that it interprets, e.g.
CS(DEPARE01) calls the symbology procedure no. 01 for objects of the
class DEPARE (depth area).
instruction to call a conditional display procedure:
The DF() command word takes the display procedure name as a parameter.
The procedure is named after the object class that it interprets, e.g.
DF(DEPARE01) calls the display procedure no. 01 for objects of the class
DEPARE (depth area).
Every entry in the lookup tables matches either all objects of a class or a subset.
Therefore the lookup tables are also used to assign the objects to so-called
viewing groups, or to classify them in the IMO/IHO 'display categories' (see
chapter 10.7.2 Mariner’s Settings). This grouping or classification is used to
enable the user to either reduce or add information shown on the screen.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 158 10 Visualization
Note:
If a text constant itself shall include inverted commas they must be marked
with a backslash each, e.g. “\”Info\””.
The right argument of the Match operator may contain ‘wild cards’:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 159
The '*' symbol represents any number of characters, there may even be no
character at all.
The '?' symbol stands for any single character.
That means
CATLAM == 4
is identical with
has CATLAM && CATLAM == 4
CATLAM != 4
would thus return TRUE for all objects for which CATLAM has been set,
but the value is not equal 4.
If an attribute shall be queried for the value 'Unknown' this can be done with
VALSOU==““
VALSOU!=““
means the attribute VALSOU has been set, and the value is not
'Unknown'.
For examples of lookup table entries see chapter 10.7.3.6 Modifying the
Presentation Library.
10.7.3.5 Rules
The majority of objects can be presented in a straightforward manner:
symbolization instructions for lines, areas or symbols are used. But there are some
complex situations like the symbolization of lights where so-called 'conditional
symbology' is required to achieve a proper presentation of objects. They are also
used when runtime variable parameters need to be evaluated for the
symbolization, e.g. the safety contour, which is dependent on the safety values
that can be changed by the user while the application is running. Conditional
symbology procedures are also used when information needed for the
symbolization is not stored in the object's attributes but in its geometry, e.g.
course lines or lines of position. Conditional symbology is different from standard
symbology because a procedure handles the symbolization rather than a
straightforward symbology instruction, i.e. decisions are made by the computer
while it is creating the presentation of an object.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 160 10 Visualization
Note:
This function is obsolete.
Based on the example in chapter 7.3 Creating Object Classes and Attributes the
following section describes how to create a separate set of tables which then can
be merged into the standard PRESLIB.
For more details about the PRESLIB syntax refer to S-52, Appendix 2, Annex A.
When designing your own objects it is desirable that their display on the screen
can be defined as well. Following are some general guidelines that should be
considered.
Design your own object class (see chapter 7.3 Creating Object Classes and
Attributes).
If your new object class is for creating point objects, design your own symbol
for it. Refer to the section of the Presentation Library documentation that
describes the symbol format. You can easily create your own symbol using an
ASCII editor. The symbol definition language is very similar to HP-GL plotter
language.
You do not need to design your own symbol if your objects will be areas or lines.
There are a variety of generic symbol commands available that can be used to
compose a symbol instruction for your new object class. Of course you can also
design a pattern symbol or line style using the symbol definition language.
The standard lookup tables are provided in binary format. Therefore they
cannot be modified. To display user-defined objects a customized set of
lookup tables must be created. These files will not be affected by Kernel
updates and will thus always be available.
In the application this set of lookup table files first must be made known to the
Kernel using the function EcChartAddLookupTable(), which returns an
identifier for this lookup table. The standard lookup tables 'simplified' and
'traditional' are known to the Kernel by default. After having set one of the
standard lookup tables with the function EcChartSetLookupTable()
the user-defined lookup table can be merged into it by calling the function
EcChartMergeLookupTable(). This function can be called as many
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 161
The following example gives the lookup table entries for the 'Recreation Resort'
class from chapter 7.3:
"recres","","AC(CHGRD);LS(DASH,2,CHBLK)","4","S","STANDARD","55555"
"recres","catres1|","AC(CHYLW);LS(DASH,2,CHRED)","4","S","STANDARD","55555"
"recres","catres2|","AC(CHGRN);LS(DASH,2,CHMGD)","4","S","STANDARD","55555"
"recres","catres3|","AC(CHGRD);LS(DASH,2,CHBLK)","4","S","STANDARD","55555"
These entries specify how objects of the class 'Recreation Resort' are presented
graphically on the ECDIS screen. Each entry (i.e. lookup table line) contains
seven fields:
Tip:
The lookup table lines that address the same object class should be stored in
one block to make them easier to maintain.
To find the symbolization instruction for a specific object, the ECDIS display
generator enters the lookup table with the object's class code, and gathers all lines
starting with this class code. If only a single line is found, field 2 has to be empty,
and the object is always shown with the same symbolization regardless of its
description.
If there is more than one line, as in our example, the display generator searches
for the entry with most attribute combinations in field 2, and tries to match these
values with the object's attributes. If this fails the line with most attribute
combinations of the remaining entries is taken. If there is more than one line with
the same amount of attribute combinations the display generator sequentially
searches them to find a match with the object's attributes. This will continue until
a matching entry is found or the line with no attribute combinations is reached.
This line holds the default symbolization instructions and will be used in case no
other matching entry is found.
The display generator uses the symbolization instruction given in field 3 of the
matching entry to symbolize the object's geometry.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 162 10 Visualization
10.8 Drawing
10.8.1 Introduction
The chart picture is the result of interpreting the Display List of one or more cells,
and executing the simple drawing commands it contains. In most cases the
drawing destination is a pixmap (an invisible, rectangular area located in the
computer's memory), which is copied into a window after the completion of the
drawing process.
Note:
If a window is specified as drawing destination an incomplete chart picture
will be shown before the drawing process is terminated. This should be strictly
avoided.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 163
Before any of the chart drawing functions can be called, the drawing engine must
be initialized by calling EcDraw[X11|NT]Initialize(). If desired, this
function creates bitmaps and a device context which can be used as parameters to
one of the drawing functions afterwards. These graphic resources can be obtained
by calling EcDraw[X11|NT]GetResources(). Alternatively, the bitmap
and device context may be created by the application. However,
EcDraw[X11|NT]Initialize() must be called in either case, because it
calculates the aspect ratio and pixel size of the screen, which are used in turn by
EcDrawSetViewport() to calculate the correct display scale and symbol size.
The counterpart of EcDraw[X11|NT]Initialize() - EcDrawEnd() -
should be called in case no more chart drawings are needed because it frees some
internally allocated resources and memory.
During the interpretation of the Display List, several filters are applied in order to
make the chart picture more legible. The first filter checks the actual scale, which
has been set indirectly by the call to EcDrawSetViewport(). The scale is
compared with the attribute ‘SCAMIN’, which may be given for every object in
the SENC file. An entry for this attribute exists in the display list. If the value of
the actual scale is larger than the object's ‘SCAMIN’ value, the display list entry
for that object will not be executed. Here is an example:
A ‘tower’ object has the ‘SCAMIN’ attribute value set to 50000, the actual chart
scale is 1:100000. Thus the tower will not be drawn. With a chart scale of
1:30000, the tower would be drawn. The chart scale can be obtained by calling
EcDrawGetChartScale(), and converted into the corresponding range by
EcDrawScaleToRange() (and vice versa by EcDrawRangeToScale()).
The second filter prevents text information from overwriting each other. Lines and
areas are clipped so that only their visible parts are drawn. Point symbols are
shown only if their geographic position is located inside the screen. Whenever a
point symbol is drawn, its bounding box on the screen is stored in the view. These
bounding boxes are used by EcQueryPickVisible() and allow to query
information about point objects without hitting their exact position.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 164 10 Visualization
charts (X11 on UNIX systems, GDI on Windows systems). This implies that
symbolization instructions have to be translated into drawing functions.
Before any charts can be symbolized or drawn with ECDIS Kernel functions the
all color definitions must be read. The function EcChartReadColors() reads
the specified file and stores the color tokens and the corresponding RGB values in
the view structure.
The parameters are:
view pointer to a view structure
name name of the color file to be read
This function returns the number of color definitions read from the specified file.
If an error occurred, the function returns 0. If the color file is not specified
(parameter name is NULL) the function tries to read the file SP52COL.DAT in
the directory /usr/local/lib/preslib4/colour/ or
$LIB_7CS/lib/preslib4/colour/ in case LIB_7CS is defined.
For a given color scheme the RGB color definitions of a color token can be
obtained as stored in the view after reading all colors. The function
EcDrawGetColorDefinition() is used to retrieve the RGB definition and
the color token if the logical index is known. The function
EcDrawGetTokenRGB() is used to retrieve the RGB definition if the color
token is known. The function EcChartGetColorByName() is used to
retrieve the logical color index if the color token is known.
The internal index table stored in the view structure assigns a logical color index
to a system palette index. Per default the color tokens are indexed in the order
they appear in the color definition file. If this internal color index table is not
changed the logical color index is identical with the system palette index, so the
value returned by the function EcChartGetColorByName() can be used in a
system palette. If however the internal color index table has been modified the
logical color index must be converted into the correct system palette index. This
can be done with the function EcGetColorIndex().
The function EcDrawSetColorIndex() can be used to modify the internal
index table and to assign a new system index to a given logical index.
EcChartAddColor() adds a new color token to the list of pre-defined tokens,
EcChartGetNumberOfColors() returns the number of defined tokens.
The number of pre-defined tokens has been increased for Kernel 5.2. There are
now 4 more tokens which are used for the SevenCs
world data set. The number of tokens is now 67. This may affect programs which
create a palette of 64 chart colors and 3 overlay planes using a total of 256 colors.
The ECDIS Kernel also provides a convenient function for setting a system
palette, the function EcDraw[X11|NT]SetColorScheme(). However, this
function is not very flexible. Usually the application will create and set a system
palette itself in order to have full control over the palette indices used for the user
interface, and other graphic elements which are not part of the chart display.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 165
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 166 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 167
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 168 10 Visualization
Cylindrical Projections
Cylindrical Equidistant Projection („No Projection“)
(NONE)
A projection in which the surface on the earth is conceived as developed on a
tangent cylinder, which is then spread out to form a plane. It has uniform
spacing of the parallels and meridians.
Spheroidal Mercator Projection
(MERCATOR)
A cylindrical projection with a cylinder tangent along the equator, meridians
appear as equally spaced vertical lines and parallels as horizontal lines drawn
farther apart as the latitude increases, such that the correct relationship
between latitude and longitude scales at any point is maintained.
Equirectangular Cylindrical Projection (Plotting Sheet Projection)
(CYLINDRIC)
Similar to Spheroidal Mercator projection, but less accurate for small scales.
Transvers Mercator Projection
(TRANSVERS_MERCATOR)
In principle equivalent to the regular Mercator Projection turned 90° in
azimuth.
Conform Gauß-Krüger Projection
(GK)
System based on Transvers Mercator Projection using belts 4° in width where
the central meridians are 3° apart. The numbers of the belts are derived from
the degrees of the central meridian divided by 3 (6°->2, 9°->3, etc.). The
Bessel Spheroid is used as the figure of reference. This system is mainly used
in Germany.
Universal Transvers Mercator Projection
(UTM)
System also based on Transvers Mercator Projection using belts 6° in width
starting from the meridian 180° east or west of Greenwich. The belts being
numbered 1 to 60, west to east. These belts are called zones. A scale factor of
k0=0.9996 is used on the central meridian of each zone. The International
Spheroid is used as the figure of reference.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 169
Zenithal Projections
Oblique Zenithal Equidistant Projection (Radar Projection)
(RADAR)
Projection, on which straight lines radiating from the center represent great
circles in their true azimuth from that center, and lengths along those lines are
of exact scale.
Oblique Zenithal Orthographic Projection (Globe Projection)
(ORTHOGRAPHIC)
Perspective projection in which the projecting lines, emanating from a point at
infinity, are perpendicular to a tangent plane.
Oblique Zenithal Gnomonic Projection
(GNOMONIC)
Perspective projection in which the projecting lines emanate from a point at
the center of the earth. Great circles appear as straight lines.
Oblique Zenithal Stereographic Projection
(STEREOGRAPHIC)
Perspective projection in which the projecting lines emanate from the
antipode.
Polar Zenithal Stereographic Projection
(POLAR_STEREOGRAPHIC)
Polar case of the Stereographic Projection, i.e. the projection axis coincides
with the polar axis of the earth. In contrary to the Stereographic Projection
mentioned above, this projection is calculated on the spheroidal earth.
Conic Projections
Lambert Conformal Projection
(LAMBERT_CONFORMAL_CONIC)
Conic projection with two standard parallels (secant conic projection), in
which the spacing of the parallels is altered, such that the distortion is the
same along them as along the meridians, making the projection conformal.
Polyconic Projection
(POLYCONIC)
Secant conic projection in which the latitude limitations have been minimized
by using a series of cones. Each parallel is the base of a tangent cone. At the
edge of the chart, the area between the parallels is expanded to eliminate gaps.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 170 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 171
Window
Display
Electronic
Chart
Copy
Heading
Viewport x
Center of Viewport
Pixmap
y Range
Clipping
Device Coordinates
EcDraw[NT|X11]DrawView
EcDrawSetViewport Affine Transformation
EcDrawSetViewportCenter (Rotation, Translation, Zooming)
Cartesian Coordinates
EcDrawSetProjection Projection
EcDrawSetLatLonFunctions
Database
Datum Transformation
ECDIS databases conform to S-57 require all geographical positions (latitude,
longitude) to be given in WGS84 datum. Therefore, the EC2007 ECDIS Kernel
assumes by default that all given positions are in WGS84; i.e. every navigational
calculation and projection initially works on WGS84. Nevertheless, if geographic
chart data are given in a local datum other than WGS84, the datum can be set
using the Kernel function EcDrawSetDatum(). If a local datum is set with this
function all calculations will be performed on this local datum. The ECDIS Kernel
includes several predefined datums, or the local datum is defined by fixed shift
values to WGS84 datum. If a local datum has been set and it is no longer needed
EcDrawSetDatum() must be called to reset to WGS84. The reset is not done
automatically.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 172 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 173
Projections
The behaviour of a projection depends on projection parameters. These
parameters are specified by the function EcDrawSetProjection(). They are
described in the following table.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 174 10 Visualization
Some of the projections are restricted to a geographic range (e.g. the Mercator
projection is not defined at the poles), and in the speed of the calculations:
Tip:
For large ranges we recommend the gnomonic projection because great circles
appear as straight lines.
The Radar projection should be used if the ECDIS display is combined with
Radar overlay. However, Mercator can be used for Radar overlay as well up to a
range of 12 NM and latitudes of 70°; the difference between both projections will
not be visible even on high resolution screens. The Gauß-Krüger projection and
UTM projection are provided for special cartographic and geodetic purposes. The
display without any projection ("No Projection") is not useful for navigational
purposes.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 175
Tip:
When a cell is going to be edited, the projection buffer should be disabled.
A good example is a cell which contains the past track of a ship. Whenever the
ship moves, a position is added to the past track. In that case, the projection buffer
should not be enabled for the view the cell concerned is assigned to.
Tip:
It is good practice to have one view for all static (read-only) cells with the
projection buffer enabled, and one separate view for the dynamic (read-write)
cells with the buffer disabled.
To find out the status of the projection buffer in a specified view you can use the
function EcDrawGetProjectionBuffer().
By default, the buffer is disabled in order to minimize memory consumption.
Enabling the buffer using EcDrawSetProjectionBuffer() will increase
the drawing speed, depending on the selected projection.
EcDrawGetProjectionBuffer() is used to get the current setting. Note
that enabling the cache may result in significant memory consumption (up to 1
MB per cell). The functions EcDrawSetProjection() and
EcDrawSetDatum() will flush the buffer because a new projection calculation
is necessary. Disabling the buffer will also flush it in order to release its memory.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 176 10 Visualization
Note:
The inverse transformation matrix is always created automatically by the
EC2007ECDIS Kernel.
Note:
In case external transformation methods are used the function
EcDrawInitViewport() must be called whenever the viewport
parameters have been changed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 177
Note:
Changing the projection does not affect the viewport settings. Panning or
zooming is still realized by calling the function EcDrawSetViewport().
Changing the projection parameters lies within the responsibility of the
application.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 178 10 Visualization
Lambert lambert;
The following text box shows how to set the projection. With the call of
LambertInit() the projection is initialized. The function call
EcDrawSetLatLonFunctions() passes the forward and reverse projection
functions and a pointer to an arbitrary piece of data containing the information
about the projection (Lambert structure) to the ECDIS Kernel. The last three
parameters of this function specify the particular projection behaviour:
poleValid specifies whether latitude of 90 degree
(PI/2) is valid for calculation
loxoStrait specifies whether the loxodrome is a strait
line in this projection
rightHand specifies whether the result of the
projection is a right-hand system
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 179
The next example shows how the ECDIS Kernel can be used to mix a raster image
with a vector overlay. First we assume that we have a georeferenced raster image,
and that there are two functions to convert the image coordinates to geographic
coordinates and vice versa. These functions are of the type
EcProjectionProc. Their prototypes are:
The problem to solve is to determine the viewport settings for matching a vector
overlay.
Note:
The y-coordinate on a raster image increases from top to bottom.
The next text box shows how to set the viewport with a given geographic position.
Width and height are the dimensions of the viewport. In this example zoom is not
supported on the raster image.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 180 10 Visualization
Navigational Calculations
For navigational calculations the following functions are used:
EcCalculateRhumblineDistanceAndBearing() calculates
loxodromic distance
and bearing
EcCalculateRhumblinePosition() calculates a position
on a rhumbline
EcCalculateGreatCircleDistanceAndBearing() calculates geodesic
distance and bearing
EcCalculateGreatCirclePosition() calculates a position
on a geodesic
The functions listed above implement the algorithms of Vincenty which give a
distance accuracy of better than one millimeter for all ranges. All calculations are
performed on the spheroidal earth.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 181
10.9 Callbacks
At certain predefined moments the EC2007 ECDIS Kernel will call special
functions. These functions are called callbacks. They are used in order to keep the
process of visualization as flexible as possible since they can be defined by the
user. Callbacks are introduced into the EC2007 ECDIS Kernel by means of the
function EcChartAddCallback(). The definition of this function is
Type Annotations
EC_PRE_SYMBOLIZE_VIEW_CALLBACK All callbacks in this list will be called
before the complete view is symbolized.
EC_PRE_SYMBOLIZE_CELL_CALLBACK All callbacks in this list will be called
before every single cell in the view is
symbolized.
EC_POST_SYMBOLIZE_CELL_CALLBACK All callbacks in this list will be called
after every single cell in the view has been
symbolized.
EC_POST_SYMBOLIZE_VIEW_CALLBACK All callbacks in this list will be called
after the complete view has been
symbolized.
EC_PRE_DRAW_VIEW_CALLBACK All callbacks in this list will be called
before the complete view is drawn.
EC_PRE_DRAW_USAGE_CALLBACK All callbacks in this list will be called
before every single usage of the view is
drawn.
EC_POST_DRAW_USAGE_CALLBACK All callbacks in this list will be called
after every single usage of the view has
been drawn.
EC_PRE_DRAW_OVERLAY_CALLBACK All callbacks in this list will be called
before the overlay is drawn.
EC_POST_DRAW_VIEW_CALLBACK All callbacks in this list will be called
after the complete view has been drawn.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 182 10 Visualization
The first parameter is the view the callback function has been logged in for; the
second parameter is a pointer to a structure which is transferred from the EC2007
ECDIS Kernel to the function.
The third parameter is a pointer to user-defined data of the function
EcChartAddCallback().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
10 Visualization Page 183
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 184
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 185
11 directENC
Note:
Previous deliveries of EC2007 ECDIS Kernel included the application
ChartHandler for chart import and maintenance. This is no longer the case.
We therefore highly recommend to utilize the respective Kernel functions
instead.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 186 10 Visualization
The SENC exchange set structure is similar to that defined by S-57 and S-63 but
can also contain SENC base cells and updates. It also supports encryption and
compression of supplementary files. In order to minimize the implementation
effort, the existing functions for handling exchange sets have been improved.
// get the type of the exchange set by checking the presence of mandatory files
// create an exchange set object and read the information from the catalog of an
exchange set
EcDENCExchangeSet *EcDENCExchangeSetReadCatalog( const char
*catalogName, FILE *errlog, Bool sortFlag );
// get the type of the exchange set from the exchange set object
EcDENCExchangeSetType EcDENCExchangeSetGetType( const
EcDENCExchangeSet *exchSet );
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 187
For an example of getting detailed information about an exchange set, please refer
to the provided sample program cellcatalog.
Please also have a look at the provided sample program testchart.
When an ENC is converted from S-63, the resulting SENC cell includes the new
permit level indicator. The value of the permit level determines whether a S-63
permit is required in order to access the cell or not. Cells created by applications
for temporary purposes (e.g. for user defined objects) do not contain this indicator
and can thus be accessed without a matching S-63 permit.
The new protection scheme does not replace the existing SENC protection
mechanism. If a SENC cell is protected by the proprietary SENC protection
mechanism a matching SENC permit is still required.
In opposition to the proprietary SENC protection mechanism where permit
handling is performed automatically by the Kernel, there is no such automatism
for the S-63 cell permits within the new protection scheme. An application that
needs to access ENCs for planning, monitoring, or rendering must explicitely
load, store and activate the cell permits by calling the appropriate Kernel
functions. For the maintenance of cell permits, a new data type for permit lists has
been introduced. A permit list is a memory structure and contains a collection of
cell permits. It must be created by an application and filled with valid permits by
reading S-63 permit files. There is no limit to the number of permit lists an
application can create but only one of them can be active. The active permit list is
the one that the Kernel uses internally in order to check whether a cell can be
accessed. The active permit list cannot be modified or deleted.
Although other permit types have already been defined, only S-63 cell permits are
used by Kernel version 5.12. Future versions will also support handling of SENC
and ARCS permits using the permit list functions.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 188 10 Visualization
Please also have a look at the provided sample program testchart. The file
containing the S-63 cell permits can be formatted either according to the S-63
standard or just contain a list of cell permits, one line each.
A permit file can contain multiple permits for a cell. The Kernel will
automatically search the list for a matching permit.
On the next page is an example how to check whether cell permits are available
for a specific cell.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 189
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 190 10 Visualization
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 191
12 Automatic Updating
12.1 Introduction
Note:
Automatic updating is also part of the directENC concept as described in
chapter 11.1. The updating procedure described here should be used only if the
directENC concept shall not be implemented. However, the Update
Infrastructure as described in chapter 12.2 applies to both approaches.
The EC2007 ECDIS Kernel supports automatic chart updating. Automatic up-
dating of Electronic Navigational Charts (ENC) is one of the most attractive
features of ECDIS technology and also an important part of its infrastructure.
Although the S-57 standard specifies in great detail the format of the update files,
the procedure of transferring the information to vessels is rather poorly described,
and barely developed and tested.
It is obvious that proven technology is necessary to ensure the correct trans-
mission of ENC data and their updates to ships. SevenCs has developed a solution
that is secure, affordable, flexible, and in conformance with the standards: S-57
updates are sent to the receiving ECDIS via e-mail.
With the EC2007 ECDIS Kernel functions the updates can be automatically
applied to the System Electronic Navigational Chart (SENC).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 192
SLIP or PPP
INMARSAT Decoder
Uplink
Service Encoder
ECDIS Provider ECDIS
World
Local Broadcast
Update Service Service
Internet
E-mail
S-57 INMARSAT
Update Service
Files
Data Production
Ship
Owner
Local
Area Individual Ship
Network Service
All chart updates are designed by an S-57 data producer. The update message for
a specific ENC is created by comparing the newly changed ENC with its
predecessor. The resulting delta information is converted into ISO8211 files
which contain S-57 update messages.
These update messages in S-57 format are then forwarded to an update distributor
where they are prepared for distribution. The S-57 update message is wrapped in
an e-mail attachment and dispatched to a local Internet provider who then
forwards the e-mail to the recipients.
Once the e-mail is on its way, three alternative routes are possible:
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 193
As shown in Figure 13.1 there are several possibilities to receive the ISO8211
update files which can be applied to the SENC of the ECDIS. If the update files
have been received on a diskette/CD or via E-mail attachment they should be
copied into the <your_path>/updates directory.
The actual ISO8211 update files are in S-57 format and have the same name as
the corresponding cell which is to be updated. The name of the original cell,
however, has the extension .000 while the extensions of the update files are
numbered consecutively, e.g. .001, .002, .003. When applying updates to a
particular cell it is important to keep the correct order. For example, an update
with extension .003 can only be applied after all previous updates, .001 and
.002, have been applied to the cell. This is checked by the function
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 194
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 195
The directory that is specified by s57Path is the path to the SENC data files
and the cell catalogue file CATALOG.7CC. The file CATALOG.7CC contains
information about the coverage, usage etc. of all cells of the SENC files.
The directory that is specified by updPath must include the subdirectories
already described. If they do not exist this function will create all subdirectories
necessary to handle the update (…/applied, …/errors, …/rejected,
…/reviewed, and …/toapply).
The function searches the subdirectory …/toapply for update files or new cell
editions. If an update is found in the …/applied directory
EcS57V3ReadUpdate() is called automatically to apply the update. If a new
edition is found the function EcS57V3ReadFile() is called automatically to
update the respective cell.
If an update is found for a cell which is not included in the SENC data (i.e. not
listed in the catalogue file CATALOG.7CC) it will be moved to the subdirectory
…/rejected. This ensures that the updates will not be lost, and can be applied
during the next function call provided that meanwhile the corresponding cells
have been loaded into the SENC.
Note:
A cell must not be mapped when applying an update. It is necessary to unmap
all cells that will be affected by an update before calling this function. Since
the function updates the cell catalogue file when applying updates it is also
necessary to free the current catalogue list of the application, and create a new
catalogue list after the updates have been applied.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 196
The information whether a particular update file has been applied successfully or
not can be written to the update history file. The parameter histFile of the
function EcS57ApplyUpdatesExt()specifies the name of the update history
file.
The last parameter specifies a callback function that informs the caller about the
current progress of the function. This function uses a given callback function to
inform the caller about the work progress.
The first parameter of the callback function is reserved for future use. The second
parameter of the callback function contains a string giving information about the
function’s current activities. The return value of the callback function is not used
in the current implementation, but reserved for future use. However, to ensure
flawless operation of the function the return value must be set to True.
For each update file that has been successfully applied to its corresponding cell a
log file is created containing information about all the changes made during
updating. These files are stored in the directory <your_path>/updates
together with the history file. All update files that have been successfully applied
will be moved to the subdirectory …/applied.
The return value of the function EcS57ApplyUpdatesExt() is the number
of successfully applied updates. The function EcS57ApplyUpdatesExt() is
a high level function which applies all available updates to their corresponding
SENC cells.
If the updates shall be handled individually for each cell the function
EcS57V3ReadUpdate()can be used. The parameters of this function are:
filename name of the update file to be read
cellid identifier of the mapped cell
di pointer to a dictionary context
errlog file to which error messages will be written
errCnt error counter
logfile log file containing information about the
changes in the cell.
This function reads the given S-57 edition 3.x update file, and modifies the cell
specified by the parameter cellid. The parameter for the error file can be set to
NULL if no error messages shall be stored.
The parameter logfile must be specified because this file is used by
the function EcS57StepUpdates() to retrieve the update information
(see the following chapter).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
11 directENC Page 197
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 198
Note:
The memory for the array of UpdateInfo structures is allocated by the
function EcS57StepUpdates(). It must be freed by the application using
the function EcFree().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 199
13 Manual Updating
13.1 Introduction
An ECDIS should not only support the automatic updating of S-57 data as
described above but should also allow the data to be manually corrected. These
changes must be visualized, and may not restrict the possibility of automatic
updating.
There are three ways to change objects by a manual update:
deleting objects
modifying objects
inserting objects
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 200 13 Manual Updating
In the first case the object will be marked as deleted, and the following attributes
will be set:
RECDAT is created automatically and holds the time
the object was deleted.
RECIND is optional and indicates who deleted the
object.
mupinf is also optional and holds comments, e.g.
the source of the information.
If the deleted object is a master object all slaves will be marked accordingly,
except for the mupinf attribute, which is only added to the master object.
In case the object to be deleted has been inserted into the SENC by a manual
update this object and all its slaves will be truly removed.
If an object shall receive some additional information this can be accomplished by
means of the function EcManualUpdateAnnotateObject(). Regardless
whether the specified object is a ‘real’ S-57 object or was inserted by a manual
update, the following attributes will be set:
RECDAT is created automatically and holds the time
the object was modified.
RECIND is optional and indicates who modified the
object.
mupinf holds information which is to be annotated.
If the given object has been previously marked as deleted, this mark will be
overwritten by this function. The attributes RECDAT and RECIND always hold
the data of the last manual update modification.
Moving an object is realized in two steps: deleting the original, object and then
creating a copy at the new position. The function
EcManualUpdateMoveObject() takes care of both these steps. This
function can only be used for point objects. It is not possible to move line or area
objects. The deletion is realized as described above, ‘real’ objects are marked as
deleted and inserted objects are removed.
Afterwards a copy of the object is created in the ghost cell. If the specified object
is a master object all slaves will be moved, too. The new position can be specified
both as absolute and relative (distance and bearing) values.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 201
The number of entries in the Manual Update List can be obtained with the
function EcManualUpdateListGetSize(). The parameters are:
maul pointer to a Manual Update List of type
EcManualUpdateList as returned by
the function
EcManualUpdateListCreate()
pType pointer to a variable of type
EcPrimitiveType (may be NULL)
Both the entire amount of entries and the number of entries of a specific geometry
primitive type can be queried, as illustrated in the following example.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 202 13 Manual Updating
EcPrimitiveType pT;
int n;
EcManualUpdateList *maul;
maul = EcManualUpdateListCreate();
// All entries
n = EcManualUpdateListGetSize(maul, NULL);
printf("%d entries in manual update list\n", n);
The text description and the primitive type can be obtained for each entry using
the function EcManualUpdateListGetInfo(). The parameters are:
maul pointer to a Manual Update List of type
EcManualUpdateList as returned by
the function
EcManualUpdateListCreate()
idx index of list entry 0 <= idx < n, where n is
returned by
EcManualUpdateListGetSize(..,NULL)
pType pointer to a variable of type
EcPrimitiveType (may be NULL)
buffer buffer for description of entry provided by
the caller (may be NULL)
bufsize size of buffer
If the Manual Update List with its predefined entries does not include all objects
needed for your purposes the list can be enhanced in the application. In this very
unlikely case, new entries can be inserted using the function
EcManualUpdateListAddEntry() and, if required, modified afterwards
with the function EcManualUpdateListExtendEntry().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 203
The following example shows the enhancement of the Manual Update List by the
two entries, a building with a flag pole and a telephone cable.
EcManualUpdateList *maul;
int idx;
maul = EcManualUpdateListCreate();
idx = EcManualUpdateListAddEntry(maul, "Building with flag pole",
EC_P_PRIM, "BUISGL", "CONVIS1|", '|');
EcManualUpdateListExtendEntry(maul, idx, "LNDMRK",
"CATLMK5|CONVIS1|", '|');
Note:
Only entries which have been inserted with the function
EcManualUpdateListAddEntry() can be modified using the function
EcManualUpdateListExtendEntry(). Furthermore, it is only possible
to modify entries of the primitive type EC_P_PRIM.
If an entry consists of a combination of objects the first object serves as the master
object when inserting this entry into the SENC as a manual update. Therefore this
object must be defined using the function
EcManualUpdateListAddEntry(). In the example the object of class
BUISGL (single building) is the master object, the object of class LNDMRK (land
mark) is a slave object. In one single entry up to three slave objects can be
defined.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 204 13 Manual Updating
The following two figures show the predefined entries of the Manual Update List.
Figure 14.1 shows the point objects, and Figure 14.2 the area objects.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 205
Tip:
We recommend to load the "full chart lookup table", otherwise the same
symbol will be used for more than one entry.
The pivot point of the symbol will be centered in the specified area. In case that
the entry represents an area object the object will be drawn using the whole area
(10 % margin).
Before an entry of the Manual Update List can be drawn the function
EcManualUpdateDraw[X11|NT]Init() must be called to initialize
drawing and create a pointer to a drawing context of type
EcManualUpdateDrawContext. This drawing context is needed by the
function EcManualUpdateDraw[X11|NT]Symbol(). After the drawing of
symbols has been completed the function EcManualUpdateDrawEnd()
should be called to free the memory allocated to the drawing context.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 206 13 Manual Updating
Note:
The first and last coordinate pairs must be equal when inserting an entry of the
Manual Update List describing an area.
Except for the attributes of the entry defined in the Manual Update List, the
following attributes are additionally set when an object is inserted:
RECDAT is created automatically and holds the time the object was created.
RECIND is optional and indicates who created the object.
Mupinf is optional and holds comments, e.g. the source of the information.
OBJNAM is optional and holds the name of the object (not for slave objects)
If a ‘real’ object from the original cell is specified its status will be reset, and the
attributes RECDAT, RECIND, and mupinf will be removed. In case the object is
a master object, the same is done with its slave objects. If an object of the ghost
cell is specified it will be deleted with all its slave objects.
If all manual updates for a specific cell shall be removed the function
EcManualUpdateWithdrawAll() can be used. The parameters are:
view pointer to a view structure
All objects of the original cell are treated as described above, and the complete
ghost cell is deleted.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 207
This function returns True if the given object has been manually updated and
False otherwise. If the object was manually updated the function additionally
returns the type of update and the information given to the object during the last
manual update. The update type (parameter updType) can be one of the
following values:
EC_MANUAL_UPDATE_INSERT
EC_MANUAL_UPDATE_DELETE
EC_MANUAL_UPDATE_ANNOTATE
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 208 13 Manual Updating
In the following example all objects of a given cell which have been deleted or
modified by a manual update are listed.
Objects that have been inserted by a manual update, i.e. which are located in the
ghost cell, can be queried using the functions EcManualUpdatePick() and
EcManualUpdateSpot(). See the ECDIS Kernel function reference for more
details on these functions.
Note:
The access of the ghost cell is EC_ACCESSNOACCESS, which means that the
application must take care of the access rights of these objects. The ECDIS
Kernel provides two functions to set and release read access for the ghost cell.
The functions are EcManualUpdateSetGhostCellAccess() and
EcManualUpdateReleaseGhostCellAccess().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
13 Manual Updating Page 209
In the following example all objects that have been inserted by a manual update
are listed.
if (num > 0)
{
// set access for ghost cell
if (EcManualUpdateSetGhostCellAccess(view, cid))
{
for (int i=0; i<num; ++i)
{
char buffer[16];
if (!EcFeatureGetClass(fList[i], di, buffer,
sizeof(buffer)))
sprintf(buffer, "Unknown");
printf("Object of class %s inserted\n", buffer);
}
EcManualUpdateReleaseGhostCellAccess(view, cid);
}
// free memory
EcFree(fList);
}
}
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 210
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
14 Tidal Predictions Page 211
14 Tidal Predictions
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 212
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
15 The Globe Page 213
15 The Globe
The SevenCs EC2007 ECDIS Kernel includes special globe and harbour data.
These data are used to display the coastlines of the entire world on a globe. The
position of several harbours can be indicated by a point symbol on this globe.
These special data and the functions of the function set EC27_Globe are well
suited to display a rough overview of the world with the outlines of the cells that
are available in the SENC.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 214 15 The Globe
The callback function for the main window handles the rotating and zooming of
the globe, the changing of projections as well as the display of the list box
containing the harbour names from which a harbour can be selected.
In the following section a detailed description of the actions not yet described in
the showcell example are given:
EcDictInfo *dictinfo;
EcView globeview;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
15 The Globe Page 215
EcGlobeSetProjection(globeview, EC_GLOBE_ORTHOGRAPHIC);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 216 15 The Globe
int scaleThreshold;
if (radiusglobe>2500)
scaleThreshold = 1000000; // all harbors are displayed
else
if (radiusglobe>300)
scaleThreshold = 5000000; // unimportant harbors are not
// displayed
else
if (radiusglobe>70)
scaleTHreshold = 10000000; // only important harbors are
// displayed
else
scaleThreshold = 50000000; // no harbors are displayed
Note:
The used radius and scale threshold values are randomly chosen and are purely
based on the appearance of the globe and harbor data in this example.
HDC globeDC;
if (!EcGlobeNTDrawGlobe(globeview, globeDC))
return FALSE;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
15 The Globe Page 217
HWND harborWindow;
EcFindInfo findInfo;
Bool result;
char name[42];
EcCoordinate lat, lon;
int scamin;
while (result)
{
// add the name to the list of harbors in the list box
SendMessage(harborWindow, LB_ADDSTRING, 0,
(LPARAM) (LPCTSTR) name);
// get the next harbor name
result = EcGlobeFindAnyPlace(globeview, name, sizeof(name),
&lat, &lon, &scamin, EC_NEXT, &findInfo);
}
The callback function of the main window checks and handles the messages from
the menu items Demo, Harbors, and Projections. The fields of the menu item
Demo are Rotate, Zoom, and Stop. When the menu item Harbors is selected the
list box containing the harbour names is shown, and a harbour can be selected.
The fields of the menu item Projections are Mollweide, Eckert, Hammer, and
Orthographic.
Rotate:
If this field is selected from the menu the globe will rotate until the Stop field
is activated. The globe can also be rotated by setting a new center position in
the viewport and redrawing the globe. See the source code of the example for
more details.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 218 15 The Globe
Zoom:
If this field is selected the globe will zoom in until a defined upper limit is
reached, and then will zoom out until a defined lower limit is reached. The
zooming can be terminated by selecting the field Stop of the Demo menu item.
The globe can be zoomed by increasing or decreasing the radius in the
viewport and redrawing the globe. See the source code of the example for
more details.
Stop:
This field is only enabled as long as the rotating or zooming action is in
process. The selection of this field causes both actions to stop.
Select a harbour name:
When selecting a harbour name from the list of harbours with a double click a
sub-function called getSelectedHarbor() retrieves the position and
name of the currently selected harbour:
// get the corresponding position and scamin value from the harbor file
if (len!=LB_ERR)
EcGlobeFindPlaceByName(globeview, name, &lat, &lon, &scamin);
}
The position of the selected harbour is set as new center position of the globe
and the globe is redrawn. See the source code of the example for more details.
Change the projection:
When changing the projection it is also necessary to set the viewport. If the
projection EC_GLOBE_ORTHOGRAPHIC is set, the globe will be displayed as
a circle. If one of the other three projections (EC_GLOBE_HAMMER,
EC_GLOBE_MOLLWEIDE, EC_GLOBE_ECKERT) is set, the globe will be
displayed as an ellipse. This should be taken into account when setting the size
of the pixmap that the globe is drawn into. The width of the pixmap and
respectively the window should double its height.
Rotating and zooming can be performed simultaneously, and a harbour can be
selected while a demo is running. However, it is not useful to select a harbour
while the globe is rotating because the center position will change continuously.
The functions used in this example are mainly from the function set EC27_Globe.
The example showglobe is called with no parameters, nevertheless it is
important to make sure that globe and harbour data are located in the default
directory \urs\local\data\world.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
15 The Globe Page 219
The ECDIS Kernel also includes two functions to draw and fill rectangles and one
function to draw polygons on the globe. These functions are
EcGlobe[X11|NT]DrawRectangle(),
EcGlobe[X11|NT]FillRectangle(), and
EcGlobe[X11|NT]DrawPloygon(), respectively.
Apart from drawing on the globe it might also be necessary to convert device
coordinates of the screen into latitude and longitude on the globe and vice versa.
The two functions EcGlobeXyToLatLon() and EcGlobeLatLonToXy()
are provided to perform these conversions. For example when allowing a panning
of the globe or realizing a marking of an area on the globe using the mouse, the
device coordinates obtained from the mouse have to be converted into the
corresponding latitude and longitude on the globe.
The place data are contained in a cell file called places4.bin, where each
harbour is stored as a place object. This place data can also be loaded and
displayed together with other SENC data. In our previous example showglobe the
harbours were displayed on the globe and their names in a list of harbours. As
described in the example, before accessing these data the function
EcGlobeLoadPlaceData() must be called, and the resources must be freed
with the function EcGlobeFreePlaceData() if no longer needed.
The EC2007 ECDIS Kernel provides three functions to access the place data.
With the function EcGlobeFindAnyPlace() the harbour information (name,
position, and scamin) can be retrieved one by one as shown in the example above.
The function EcGlobeFindPlaceByName() is used to retrieve the
position and scamin value of a harbour specified by its name (see also the
showglobe example).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 220 15 The Globe
The returned harbour is the one nearest to the specified position within the given
radius.
The place data can be modified, too. With the function EcGlobeAddPlace() a
new harbour can be added to the place data, and with the function
EcGlobeRemovePlace() a harbour can be deleted from the place data.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 221
16 Route Handling
16.1 Introduction
The technology of the Electronic Chart Display and Information System (ECDIS)
is used by the mariner in the same way as the traditional paper sea chart: to
navigate his vessel from port A to port B. Therefore, ECDIS supports the same
kind of chart work as the paper chart but in a digital and much more flexible way.
On the paper chart the actual route is planned with pencil, divider, and ruler after
erasing all other alternative routes. All electronic aids for navigation (e.g. Satellite
Navigators) support this concept and allow old routes to be stored but only one
route to be loaded and used: the preferred and actual route.
A different concept is supported by ECDIS: The elements of route planning in
ECDIS are the waypoints and the leglines or legs which connect the waypoints.
While waypoints may stand alone legs are always bounded by waypoints. Legs
are connected to exactly two waypoints, one at each end. However, a waypoint
may be connected to any amount of leglines. This makes a waypoint a node in a
network of leglines. The routes used during a voyage can be connected at
significant waypoints to build a route network. Waypoints and legs in an ECDIS
carry more information than their counterparts in the paper chart. Legs can be
constructed for a preplanned speed, and waypoints carry information about the
turning radius of the next course change etc.
But how will the mariner find his way through this network of leglines and
waypoints? ECDIS provides two kinds of leglines and waypoints: Those
belonging to a preferred route (i.e. the actual route taken), and those belonging to
alternate routes.
Note:
This cell must be mapped with write access in order to be able to add and
remove objects.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 222 16 Route Handling
// read dictionaries
dictInfo=EcDictionaryReadExt("objcatv3.dic","atrcatv3.dic",stderr);
if (dictInfo == NULL)
// dictionaries could not be read; error handling
This function creates a legline with the specified characteristics. The two given
waypoint objects form the start and end waypoint of the created legline. If a leg
already exists between these two waypoints, no new legline will be created, and
the handle of the existing leg will be returned by this function. With the macro
ECOK() the returned handle can be checked for success.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 223
To be able to create a legline a start and end waypoint are needed. With the
function EcRouteAddWaypoint() a new waypoint feature object can be
created. The parameters are:
cellid identifier of a mapped cell (user-defined
objects cell)
dictInfo pointer to an object dictionary context
lat latitude of the waypoint in degrees
lon longitude of the waypoint in degrees
pickRadius radius to search for other waypoints in
nautical miles
turnRadius turning radius of the waypoint in nautical
miles
The parameters lat and lon specify the position of the new waypoint object. If a
waypoint already exists at the specified position or in the near vicinity that is
defined by the pickRadius, no new waypoint will be created. If the specified
position is on or in the near vicinity of a legline, this leg will be split into two legs
with the new waypoint inserted and connected to both leglines. The function
returns a handle of either the newly created or the already existing waypoint
object.
Note:
This function not always creates exactly one new feature object. If for example
a waypoint already exists at the specified position no waypoint feature object
will be created; or if a waypoint is inserted into an existing leg this will be
split, and an additional legline feature object created. It is important to keep
this in mind when considering the symbolization of the entire cell or a single
feature object.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 224 16 Route Handling
first = False;
}
else // next waypoint
{
// create next waypoint
wp2 = EcRouteAddWaypoint(udoCid, dictInfo, latPos, lonPos,
PICKRADIUS, TURNRADIUS);
if (!ECOK(wp2))
// creating next waypoint failed, error handling
The EC2007 ECDIS Kernel software also provides functions to remove leglines
and waypoints. With the function EcRouteDeleteLegLine() a legline
feature object can be deleted. The parameters are:
dictInfo pointer to an object dictionary context
leg handle of the legline object to be deleted
The function only deletes a legline feature object in case this does not belong to a
selected (preferred) route (see below for details on selecting a route). The
waypoints that are connected to the specified leg will not be touched. The function
returns True on success and False otherwise.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 225
Since a legline cannot exist without its bounding waypoints all leglines that are
connected to the specified waypoint will be deleted as well. As with the function
EcRouteDeleteLegline(), only waypoint objects that do not belong to a
selected route can be deleted. If a selected waypoint is specified the function
returns False and True on success.
Apart from creating and deleting waypoints and leglines there is also an EC2007
ECDIS Kernel function which enables an existing waypoint to be moved to a new
position. The function is called EcRouteMoveWaypoint(), and the
parameters are:
cellid identifier of a mapped cell (user-defined
objects cell)
dictInfo pointer to an object dictionary context
datum horizontal datum
waypoint handle of the waypoint object to be moved
newlat new latitude of the waypoint in degrees
newlon new longitude of the waypoint in degrees
pickRadius radius to search for other waypoints in
nautical miles
This function moves the specified waypoint to the new position including all its
attached leglines. If there is already a waypoint located at the given position or in
the near vicinity the two waypoints will be merged into one. This is realized by
removing the specified waypoint and connecting all its legs to the already existing
waypoint. The function returns True on success and False otherwise.
Note:
The function EcRouteMoveWaypoint(), unlike the functions
EcRouteDeleteLeg() and EcRouteDeleteWaypoint(), does not
take into account that a specified waypoint is part of a selected route. Since it
is not intended that a preferred route can be changed in any way, the
application needs to check if the specified waypoint is selected or not.
The state of a waypoint or legline feature object is stored in its attribute ‘select’.
The value 1 indicates that the object is part of a ‘planned’ or preferred route, value
2 indicates that the object is part of an ‘alternate’ route, and 0 indicates an
‘undefined’ state. The following example shows how to get the state of a
waypoint or legline feature object. In case the object is part of a preferred route
True is returned, if the object is part of an alternate route or if the state is
undefined False is returned. See example on next page.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 226 16 Route Handling
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 227
The selection process always starts with a waypoint feature object and stops when
the way through the network becomes ambiguous, or an end waypoint is reached.
However, by passing a legline feature object that is connected to the last waypoint
of an already selected route the selection process can be continued. It is also
possible to extend an already selected route by passing the last waypoint of the
already selected route as startObj. The return value of this function is as
follows:
0 on success (end waypoint was reached)
1 on unambiguous continuation (next legline needs to be specified)
<0 on error (e.g. specified legline is not connected to the last waypoint of
an already selected route)
Note:
When specifying as start object a waypoint that is not the end waypoint of an
already selected route a new preferred route is started from that point on.
It is however possible to select more than one preferred route. This can be realized
by creating additional route feature objects by means of the function
EcRouteInit().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 228 16 Route Handling
To retrieve all route feature objects of a given cell one by one the function
EcRouteSpot() is used. This function takes the following parameters:
cellid identifier of a mapped cell (user-defined
objects cell)
dictInfo pointer to an object dictionary context
fi buffer of type EcFindInfo to store the
iteration state
first flag indicating first or subsequent calls
(EC_FIRST or EC_NEXT)
The return value of this function is a handle of a route feature object available in
the given cell. To retrieve all route objects of the given cell this function should
first be called with EC_FIRST as parameter, and all subsequent calls with
EC_NEXT as parameter. When no more route objects are available the returned
value is an empty handle. The macro ECOK() can be used to check whether the
returned object is valid.
After the preferred route has been determined showing all alternate routes of the
network may overload the chart display and distract from the preferred route. The
EC2007 ECDIS Kernel therefore allows to switch off the display of the alternate
routes, with only the preferred route remaining visible on the chart display. The
function EcChartSetShowAlternateRoute() is used to realize this (see
also chapter 10.7.2 Mariner’s Settings).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 229
To permanently save and reuse a route network and a selected route, the EC2007
ECDIS Kernel provides functions to export and import all waypoint, legline, and
route feature objects of a given cell. The function EcRouteExport() writes all
preferred and alternate routes into an S-57 edition 3.x file. The parameters are:
cellid identifier of a mapped cell (user-defined
objects cell)
dictInfo pointer to an object dictionary context
fileName name of the export file
Note:
The version string of the cell header must be set to
S57_VERSION_3_STRING before a route can be exported. This is done
automatically when creating a new cell with the function EcCellCreate(),
or can be done manually with the function EcCellSetHeaderInfo().
The route export file that is created with this function can be imported by other
ECDIS systems enabling other vessels to use the constructed route network and
selected preferred route.
The function EcRouteImport() reads all preferred and alternate routes from
the specified S-57 file. The parameters are:
cellid identifier of a mapped cell (user-defined
objects cell)
dictInfo pointer to an object dictionary context
fileName name of the export file
Note:
All route, waypoint, and legline objects already existing will be removed from
the given cell and replaced by the objects in the specified file.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 230 16 Route Handling
It is not easy to define criteria to optimize a route but there is a set of minimum
requirements a route has to fulfil for every vessel in every trade:
A preferred route should not cause the grounding of a vessel
A preferred route should not cause the collision of the vessel with floating or
fixed objects or obstacles
A preferred route should take into account that the vessel may deviate more or
less from the route
These safety values are the basis for the route check and are therefore passed to
the function EcRouteCheck(). This function checks a preferred route and
takes the following parameters:
safeDepth safety depth in meters
airDraft air draught in meters
safeDist safety distance in nautical miles
datum horizontal datum
dictInfo pointer to an object dictionary context
dngInfo pointer to a danger dictionary
route handle of the route object
catList pointer to a cell catalogue list
addCellList array of mapped cell IDs which should be
checked additionally
numOfCells number of additional cells
view pointer to view context
leg pointer to last leg or leg where dangers
occurred
dngobjs pointer to array of dangerous feature
objects
The first three parameters of this function specify the above mentioned safety
values. These are dependent on the vessel currently using the ECDIS and the
judgement of the mariner. The parameter dngInfo is a pointer to a danger
dictionary context of type EcDangerInfo as returned by the function
EcQueryReadDangerDictionary() (see function reference for details).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 231
Note:
This function allocates memory to the array of dangerous feature objects
dngobjs, which must be freed by the application when it is no longer needed
using the function EcFree().
In case the route check encounters a violation of the safety parameters the route
has not been properly planned and must be corrected. The selected route can be
partially deselected from the point where the first dangerous object was
encountered by passing the returned leg feature object to the function
EcRouteReleaseLegLine(). This part of the route can then be modified.
After correcting the route it has to be selected again and checked again until the
entire course of the route is free of dangerous objects.
After the preferred route has been successfully checked it may be useful to save it
into a file using the function EcRouteExport() and / or to create a waypoint
list showing all waypoints of the preferred route as well as the distances and
bearings to the respective next waypoint.
To realize such a waypoint list of the preferred route, first the function
EcRouteGetPlannedWaypoints() can be used to retrieve all waypoints of
a preferred route one by one. The parameters are:
route handle of the route object
dictInfo pointer to an object dictionary context
fi buffer of type EcFindInfo to store the
iteration state
first flag indicating first or subsequent calls
(EC_FIRST or EC_NEXT)
The function returns a handle of a waypoint feature object which can be checked
with the macro ECOK(). If no route object exists the function returns an empty
handle.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 232 16 Route Handling
To get the name of a waypoint object the value of its attribute ‘OBJNAM’ has to
be retrieved from the object’s attribute list. This is realized with the functions
EcFeatureQueryAttribute() and
EcDictionaryTranslateAttributeValue().
The latitude and longitude of the waypoint’s position can be retrieved by means of
the function EcObjectGetLocation(), and the returned values can be
converted into a string by using the function EcOutPositonToString().
More information about each waypoint like its turning radius is stored in the
object’s attributes and can be retrieved just like the name.
The following example shows how to get the waypoint information using the
functions mentioned above, and how to write this information into a string.
EcFeature firstWp;
char attribute[42], buffer[255], wpString[500];
EcCoordinate lat, lon;
double depth;
EcFindInfo wpfi;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 233
To calculate the distance and course to go to the next waypoint the legline
between the current and the next waypoint is needed. The function
EcRouteWaypointGetLegLines() is used to retrieve all legline objects
connected to a given waypoint. The parameters are:
waypoint handle of the waypoint object
dictInfo pointer to an object dictionary context
fi buffer of type EcFindInfo to store the
iteration state
first flag indicating first or subsequent calls
(EC_FIRST or EC_NEXT)
otherlat latitude of other end of leg
otherlon longitude of other end of leg
The function returns a handle of a legline object connected to the given waypoint.
The macro ECOK() should be used to check whether the handle is valid or no
more leglines have been found. The parameters otherlat and otherlon
additionally hold the position of the waypoint connected to the other side of the
returned legline.
In the example for creating a waypoint list, first the name and position of the first
waypoint is retrieved (see above). The next step is to retrieve the next waypoint
and all its leglines. For each legline it is then checked if the position of the
waypoint connected at the other end is equal to the position of the previous
waypoint of the preferred route.
EcFeature nextWp;
EcCoordinate prevlat, prevlon;
EcFindInfo legfi;
Bool legFound = False;
…
// get the next waypoint of the preferred route
nextWp=EcRouteGetPlannedWaypoints(route, dictInfo, &wpfi, EC_NEXT);
while (ECOK(nextWp))
{
// get the legline between the current and the next waypoint
leg=EcRouteWaypointGetLegLines(nextWp, dictInfo, &legfi, EC_FIRST,
&prevlat, &prevlon);
while ((ECOK(leg)) && (!legFound))
{
// check if legline is connected to previous waypoint
if ((lat == prevlat) && (lon == prevlon))
legFound = True;
// get the next legline of the waypoint
leg=EcRouteWaypointGetLegLines(nextWp,dictInfo,&legfi,EC_NEXT,
&prevlat,&prevlon);
}
…
}
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 234 16 Route Handling
With the leg object and the position of the start and end waypoints the distance
and bearing between these waypoints can be calculated. The calculation of the
distance and bearing between two points depends on the line characteristic on the
earth’s surface, rhumb line or great circle. The legline characteristic is stored in
the attribute ‘legchr’ of the leg object. To retrieve its value the functions
EcFeatureQueryAttribute() can be used. The attribute ‘legchr’ is of
type enumeration. The value 1 stands for rhumb line, and value 2 for great circle.
In the function set EC27_Navigation of the EC2007 ECDIS Kernel there are two
functions to calculate the distance and bearing between two points:
EcCalculateRhumblineDistanceAndBearing()
for the line characteristic rhumb line and
EcCalculateGreatCircleDistanceAndBearing()
for the line characteristic great circle. The functions take the same parameters,
except that a start and end bearing is calculated for the line characteristic great
circle. The parameters are:
datum local horizontal datum
lat1 latitude of start position
lon1 longitude of start position
lat2 latitude of end position
lon2 longitude of end position
dist distance in nautical miles
course bearing in nautical degrees
[startCourse for great circle]
[endCourse for great circle only; end bearing in nautical
degrees]
Following on the next page is the continued example for creating a waypoint list.
With the leg object between the current and the next waypoint the distance and
course to go to the next waypoint is calculated and concatenated to the string
holding the information about the current waypoint.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 235
double dist;
double startCourse, endCourse;
…
// get the position of the next waypoint
EcObjectGetLocation(nextWp, EC_CENTERPOS, &lat, &lon, &depth))
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 236 16 Route Handling
This function returns a so-called routing object which represents hidden and
necessary information for the optimization. All other functions of this group need
this routing object as a parameter!
The following example creates a routing object based on the routing network
delivered from SevenCs GmbH.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 237
EcRoutingGetAllObjects()
EcRoutingQueryNode()
EcRoutingQueryLeg()
EcRoutingGetNearestNodes()
EcRoutingGetNearestLegs()
In the following example all found nodes are put into the list “nodeprop”:
EcDictInfo *di;
EcRouting *routing;
EcNodeInfo *nodeprop;
int numberNodes;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 238 16 Route Handling
After having gathered information about all nodes and/or all legs the allocated
memory must be freed. This is done with the functions
EcRoutingFreeNodeInfos();
EcRoutingFreeLegInfos();
The following example retrieves all information about the node “wp1” of the
routing object “routing”.
EcRouting *routing;
EcDictInfo *di;
EcRoutingNodeName currentNodeName = "wp1";
EcRoutingNodeInfo *currentInfo;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 239
EcRouting *routing;
EcDictInfo *di;
EcCoordinate lat = 43.373668;
EcCoordinate lon = 8.683521;
EcRoutingNodeInfo *node;
The returned value result is the number of found closest nodes. In general the
value is one. However, in some special cases there may be more than one closest
nodes:
Imagine a user-defined lat/lon position exactly in the centre of a graph consisting
of four nodes and four legs defining a quad. In this special case the list of closest
nodes will contain four items!
After having gathered all information use the function
EcRoutingFreeNodeInfos() to free all allocated memory:
EcRoutingFreeNodeInfos(node, result);
The function EcRoutingGetNearestLeg() operates analogically. After
using this function allocated memory must be freed with
EcRoutingFreeLegInfos().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 240 16 Route Handling
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 241
It is important to understand that this function works according to the principle all
or nothing, i.e. before making any changes the function will check whether all
nodes in the node list are changeable.
Imagine the following example:
There are three nodes in the current node list and the parameter action is set to
EcRoutingMove. The function then “realizes” that one of the three nodes does
not exist in the routing network. Thereupon the function will return false to
indicate that one desired movement is impossible.
There are five nodes in the current node list, and the parameter action is set to
EcRoutingAdd. The function “realizes” that the object names of two nodes
from the list shall be changed to object names which still exist within the routing
network. Since this is impossible the function will return false to indicate that
nothing has been changed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 242 16 Route Handling
The following matrix describes the behaviour of this function in accordance to the
user-defined parameter settings (“X” indicates that the setting of this parameter is
mandatory):
It is important to understand that this function works according to the principle all
or nothing: i.e. before making any changes the function will check whether all
nodes in the node list are changeable.
Note:
Legs cannot be moved! If you want to move legs move one of the attached
nodes using EcRoutingModifyNodes() with the parameter
EcRoutingMove. The leg will then be moved automatically.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 243
The calculated shortest route is converted into an S-57 SENC file named
Routes.7CB in the directory C:\Routing\RouteObjects.
EcRouting *routing;
EcDictInfo *di;
EcRoutingNodeName sNode = "NEW YORK";
EcRoutingNodeName eNode = "CASABLANCA";
EcRoutingNodeName via[2];
char *OutputFile = "C:/Routing/RouteObjects/Routes.7CB";
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 244 16 Route Handling
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 245
EcDictInfo *di;
EcRouting *routing;
EcFindInfo fi;
EcFeature firstwp, secondwp;
char attribute[255], buffer[255];
//i >= 1
int i = EcRoutingGetNearestNodes(routing, di, startlat, startlon,
&entryNode);
//j >= 1
int j = EcRoutingGetNearestNodes(routing, di, endlat, endlon,
&exitNode);
//calculate the shortest route between the found entry node and exit
node.
//put the route object in “OutputFile”
char *OutputFile = "C:/shortestRoutes/route1.7CB";
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 246 16 Route Handling
//deallocate memory
EcRoutingFreeNodeInfos(entryNode, i);
EcRoutingFreeNodeInfos(exitNode, j);
while ( ECOK(feature) )
{
if ( EcFeatureIsClass (feature, di, "waypnt") )
{
//get object names of the waypoints
EcFeatureQueryAttribute( feature, di, "OBJNAM", attribute,
sizeof(attribute) );
EcDictionaryTranslateAttributeValue( di, attribute, buffer,
sizeof(buffer) );
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
16 Route Handling Page 247
}//end while
//unmap cell
EcCellUnmap( temp );
//deallocate memory
EcRoutingFreeDatabase(routing);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 248
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
17 Monitoring Page 249
17 Monitoring
17.1 Introduction
The 'ECDIS Performance Standards' require not only to check the planned route
prior to the start of the voyage but also to check the vessel’s position in relation to
the planned route, and the surrounding dangers at any given time during the
voyage:
"In order to safeguard against the risk of grounding, a position-monitoring system
shall enable detection of cross-track error in relation to the pre-planned route and
release an alarm at a time to danger of grounding which allows for proper and
effective action to be taken by the back-up officer" [Watch-1 Specification of Det
Norske Veritas].
ECDIS can perform even more than anti-grounding, its motion prediction allows
the mariner to see where his vessel will be positioned within the next few minutes.
This prediction is not a simulation! It is simply the extrapolation of the actual
motion parameters and therefore applicable for all types of vessels - from the
smallest pilot launch to the largest super tanker. See chapter 17.6 Prediction for
more details.
Note:
Only one waypoint of the entire preferred route can be activated. The function
ensures that only the specified waypoint is activated and all others are not.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 250 17 Monitoring
To retrieve the distance and bearing of the own ship to the active waypoint the
function EcMonitorGetActiveWaypoint() can be used. The parameters
are:
cellId identifier of the mapped cell containing the
route object
dictInfo pointer to a dictionary context
datum horizontal datum
shipLat Latitude of the ship’s current position
shipLon Longitude of the ship’s current position
dist distance to the activated waypoint
course course to the activated waypoint
The return value of this function is a handle to the activated waypoint, which can
be checked for errors using the macro ECOK().
Note:
The attribute xtrack has been defined by SevenCs for navigational purposes
and is not part of the official IHO Mariners’ Navigational Objects.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
17 Monitoring Page 251
17.4 Anti-Grounding
As already mentioned above an ECDIS should provide a warning or alarm
function to help prevent the vessel from grounding or the collision with
obstructions. To realize such a warning function a so-called guard zone is defined
in front of the path of the vessel. This area will be checked for any objects that
may be dangerous to the vessel.
The function EcMonitorDefineGuardZone() is used to create a guard zone
feature object. The parameters are:
cellId identifier of a mapped cell
dictInfo pointer to a dictionary context
numCoor number of coordinate pairs of the guard
zone area
name name of the guard zone (optional, may be
NULL)
This function only creates a feature object for the guard zone, the actual geo-
graphic location, i.e. the coordinates of the vertices can be specified by means of
the function EcMonitorMoveGuardZone(). The parameter numCoor
specifies the number of coordinate pairs needed to define the guard zone area.
This number has to be by one greater than the number of vertices of the area,
since the first coordinate must be identical to the last coordinate. E.g. to define a
guard zone with N vertices the number of coordinates is N+1.
Note:
The amount of coordinates must be at least 4 which makes a triangle the
simplest guard zone area possible.
The name that can be given is set in the objects attribute ‘OBJNAM’ and can be
used to distinguish the guard zone. The return value of this function is a handle to
the created feature object which can be checked for errors with the macro
ECOK().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 252 17 Monitoring
Before checking the guard zone for possible dangerous objects the geographic
location must be set. With the function EcMonitorMoveGuardZone() the
coordinates of the guard zone’s vertices can be set. With this function the absolute
coordinates of the vertices can be specified, or the coordinates relative to a given
position and course. The parameters are:
guardzone handle of guard zone feature object
dictInfo pointer to a dictionary context
lat latitude of reference position
lon longitude of reference position
course reference alignment in nautical degrees
coords array of guard zone coordinate pairs (lat/lon
or distance/bearing)
ncoords number of coordinate pairs in coords
array
absolute flag indicating absolute or relative
coordinates
The handle of the guard zone feature object is returned by the function
EcMonitorDefineGuardZone() when creating a guard zone. If the
parameter absolute is set to True the specified coordinates will be interpreted as
absolute latitude and longitude values. In this case the reference position lat and
lon and the reference alignment course will be ignored.
If the parameter absolute is set to False the coordinates will be interpreted as
distance and bearing from the given reference position and reference alignment,
e.g. the current ship position and course.
The example following on the next page shows how to create a triangular guard
zone object and place it in front of the own ship by using the current ship position
and course as reference point.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
17 Monitoring Page 253
EcCellId udoCid;
EcDictInfo *dictInfo;
EcFeature guardZone;
EcCoordinate shipLat, shipLon;
double shipCourse;
double angle = 20.0;
double dist = 1.5;
double coor[4*2];
To check if any dangerous objects are inside the defined guard zone area the
function EcMonitorCheckGuardZone() can be used. This function searches
the guard zone area for dangerous objects.
The dangerous objects are listed in a danger dictionary file called dngcat.dic
in the directory $LIB_7CS/lib/objcat. The object classes included in this
file are categorized by the three key words NOTE, WARNING, and DANGER. Since
this file is in ASCII format it can be edited to suit individual requirements of the
warning function realized in the ECDIS.
The ECDIS Kernel function EcQueryReadDangerDictionary() reads the
danger dictionary file, and stores its information in an internal structure of type
EcDangerInfo which is returned by this function. If it is no longer needed the
returned danger dictionary context must be freed by the application using the
function EcQueryFreeDangerDictionary().
Apart from the danger dictionary context the function checking the guard zone
area needs the cells that are supposed to be checked. These cells should cover the
area that is defined by the guard zone and have to be loaded and stored in an array
of cell identifiers. The functions EcCellLoadByArea() or
EcCellLoadByPolygon() can be used to load the cells needed, and retrieve
the respective cell identifiers.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 254 17 Monitoring
The following example shows how to retrieve the required cells by using the
function EcCellLoadByArea().
#define MAX_CELLS 16
EcPrimitive prim;
EcPrimitiveType primType;
EcCoordinate minlat, minlon, maxlat, maxlon;
EcCellId cellIds[MAX_CELLS];
int numCells;
EcFindInfo fi;
EcCatList *catList;
// create and position a guard zone object as described in the previous example
// check the guard zone area and unmap the cells; see example below
When the coordinates of the guard zone vertices are known the function
EcCellLoadByPolygon() can be used to load the required cells, and retrieve
the needed cell identifiers. However, this function has a linear execution time
depending on the number of vertices of the given polygon. It is therefore not
recommended to use this function when the guard zone area is defined by a large
amount of vertices.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
17 Monitoring Page 255
Note:
If the return value is 0 no memory will be allocated to the array dngObj.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 256 17 Monitoring
The following example is a continuation of the two previous examples and shows
how to check the guard zone area using the function
EcMonitorCheckGuardZone().
#define MAX_CELLS 16
EcDangerInfo *dngInfo;
EcFeature *dngObjects;
double safetyHeight, safetyDepth;
int numDngObj;
// create and position a guard zone object and retrieve the needed cell ids
// covering this area as described in the previous examples
// check the guard zone area using the cells retrieved in the previous example
numDngObj = EcMonitorCheckGuardZone(guardZone, dictInfo, dngInfo,
safetyDepth, safetyHeight, EC_NOTE_LEVEL,
cellIds, numCells, &dngObjects);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
17 Monitoring Page 257
It is also possible to clear an existing past track to start recording the ship’s track
anew. The ECDIS Kernel function EcMonitorClearPastTrack() removes
all information stored in the given past track object. However, the object proper is
not deleted and can be used to set new ship relevant information.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 258 17 Monitoring
Any textual information attached to the specified time label of the past track can
be queried with the function EcMonitorGetPastTrackData().
17.6 Prediction
The prediction functionality of the ECDIS Kernel is normally used to determine
the movement of the ship when precise manoeuvring is required.
The function EcMonitorCalculatePrediction() predicts the ship’s
position in a specified time on the basis of the current position, course, and speed.
The parameters are:
timediff prediction time interval in seconds
curlat current latitude of the ship’s position
curlon current longitude of the ship’s position
heading current heading of the ship
cmg current course made good of the ship
speed current speed of the ship
rateOfTurn current rate of turn in degrees per minute
predLat predicted latitude of the ship’s position
predLon predicted longitude of the ship’s position
predHeading predicted heading of the ship
rotLat latitude of rotation center point
rotLon longitude of rotation center point
This function calculates the ship's position and heading from the parameters of the
current ship's movement. This algorithm is not a simulation of the ship's
movement. If the parameters change rapidly the predicted situation will change,
too. It is not useful to specify a time interval for the prediction greater than 60
seconds.
Note:
The calculation is independent of e.g. the ship's length, breadth, deadweight
etc.. Therefore the movement prediction can be calculated for every type of
vessel.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 259
18 Sensor Data
18.1.1 Introduction
The EC2007 ECDIS Kernel includes functions to handle navigational sensor data
in the IEC 61162-1 standard format, which is derived from the NMEA 183 format
specification. An ECDIS needs to be connected to navigational sensors to be able
to fulfil the requirement of displaying the current ship’s position on the chart.
Additionally, the ship’s heading and speed over ground are needed to display a
ship symbol. It may also be desired for an ECDIS to record the received sensor
data to realize black box functionality.
The IEC 61162-1 standard specifies the electrical connection between two
navigational devices as well as the data transmission format. A RS-422 interface
is required for the electric connection, however, for compatibility reasons the RS-
232 interface should also be connectable. Both the RS-422 and the RS-232 are
serial interfaces which need to run with the following parameters:
4800 Baud
8 data bits, no parity bit
1 stop bit
Tip:
More detailed information can be obtained from the IEC 61162-1 standard and
the documentation of the respective navigational sensors.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 260 18 Sensor Data
The status field gives more details about the error that has occurred. Possible
values are:
EC_ERROR_CHECKSUM // invalid checksum detected
EC_ERROR_INVAL // no telegram specified
EC_ERROR_FATAL // cannot allocate memory
EC_ERROR_MISS_FIELD // unexpected end of telegram
EC_ERROR_PROP // proprietary sentences are unsupported
EC_ERROR_QUEST // query sentences are unsupported
EC_ERROR_FORMAT // value of unexpected type detected
EC_ERROR_UNKNOWN_MSG // type of given sentence is unsupported
EC_ERROR_NOTERM // telegram delimiter not found
Since the message type is stored in the EcNmea structure it can be retrieved from
there. It is, however, also possible to register specific message types for a serial
line in order to implement that only these types of messages shall be parsed, and
all others shall be ignored.
The function EcSensor[X11|NT]AddTelegram() is used to register
message types. The parameters are:
filehandle file handle/descriptor for which the
message type is being registered.
telegram three-character code identifying the
message type.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 261
It is possible to register more than one message type for a particular serial line,
which is identified by its file handle/descriptor.
To check if a message that has been read is of a registered type, the message type
(three-character code) must be taken from the read message. With this message
type the function EcSensor[X11|NT]CheckTelegram() can be called.
The parameters are:
filehandle file handle/descriptor for which the
message type registration is being checked.
telegram three-character code identifying the
message type.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 262 18 Sensor Data
This function returns True if the specified message type is registered and False
otherwise.
The following example (for UNIX) describes the steps necessary to implement the
parsing of messages of type GGA and VTG. The serial line is opened and
initialized, the message types GGA and VTG are registered for that line, the
messages are read, and only the GGA and VTG type messages are parsed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 263
if( fd < 0 )
{
fprintf( stderr, "Cannot open device: %s\n", devName);
return -1;
}/*if*/
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 264 18 Sensor Data
The registration of message types for a particular serial line can also be handled
during the runtime of the ECDIS application. With the functions
EcSensor[X11|NT]AddTelegram() and
EcSensor[X11|NT]RemoveTelegram()
the list of registered message types can be modified. To retrieve this list of
registered types as a whole the function
EcSensor[X11|NT]GetTelegrams() can be used.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 265
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 266 18 Sensor Data
typedef union
{
int msgType;
EcDBT_type DBT;
EcDPT_type DPT;
EcDTM_type DTM;
EcGGA_type GGA;
EcGLL_type GLL;
EcHDT_type HDT;
EcHDG_type HDG;
EcMWV_type MWV;
EcOSD_type OSD;
EcRMC_type RMC;
EcROT_type ROT;
EcRPM_type RPM;
EcRSA_type RSA;
EcSNU_type SNU;
EcTLL_type TLL;
EcTTM_type TTM;
EcVBW_type VBW;
EcVHW_type VHW;
EcVTG_type VTG;
EcZDA_type ZDA;
EcERROR_type Error;
}EcNmea;
These structures consist of different data fields for the different values of the
message. However. the following data fields are contained in the structure for all
message types:
msgType define for the message type (see below)
timestamp time when the message was parsed
available bit mask indicating which data fields of the telegram
are filled
talker define for the device type (see below)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 267
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 268 18 Sensor Data
EC_SENSOR_INT_INSTRUMENTS // II
EC_SENSOR_INT_NAVIGATION // IN
EC_SENSOR_LORAN_A // LA
EC_SENSOR_LORAN_C // LC
EC_SENSOR_OMEGA // OM
EC_SENSOR_RADAR // RA
EC_SENSOR_SOUNDER_DEPTH // SD
EC_SENSOR_POSITIONINGSYSTEM // SN
EC_SENSOR_SOUNDER_SCANNING // SS
EC_SENSOR_TURNRATE_INDICATOR // TI
EC_SENSOR_TRANSIT // TR
EC_SENSOR_LOG_DOPPLER // VD
EC_SENSOR_LOG_MAGNETIC // VM
EC_SENSOR_LOG_MECHANIC // VW
EC_SENSOR_WEATHER_INSTRUMENTS // WI
EC_SENSOR_TRANSDUCER // YX
EC_SENSOR_ATOMIC_CLOCK // ZA
EC_SENSOR_CHRONOMETER // ZC
EC_SENSOR_QUARTZ_CLOCK // ZQ
EC_SENSOR_RADIO_UPDATED_CLOCK // ZV
EC_SENSOR_PROPRIETARY_CODE // P
EC_SENSOR_DGPS
Note:
Since the IEC 1162-1 standard allows message fields to contain no data, the
member available should always be evaluated before accessing the data
stored in the structure.
On the following pages all message types which are supported by the Kernel
functions are listed. The descriptions include the specification of the message type
in the IEC 1162-1 standard, the corresponding data structure used to store the
values, and the defines for the bit mask combination of the data field
available.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 269
$--DBT,x.x,f,x.x,M,x.x,F*hh<CR><LF>
1 2 3
1. Water depth - in feet. Converted into meters and stored in field DBT.depth.
2. Water depth - in meters. If no data in first field the value is stored in field
DBT.depth.
3. Water depth - in fathoms. If no data in the first two fields the value is
converted into meters and stored in field DBT.depth.
The structure EcDBT_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double depth; // depth (referenced to transducer) in meters
int talker; // code for the device type
}EcDBT_type;
The define for the bit mask combination of the data field available is as
follows:
EC_DBT_DEPTH 1
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 270 18 Sensor Data
DPT - Depth
IMO Ref. A224 (VII). Water depth relative to the transducer and offset of the
measuring transducer. Positive offset numbers provide the distance from the
transducer to the waterline. Negative offset numbers provide the distance from the
transducer to the part of the keel of interest.
$--DPT,x.x,x.x*hh<CR><LF>
1 2
The structure EcDPT_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double depth; // depth (referenced to transducer) in meters
double offset; // transducer offset in meters:
// + => to water-line, - => to keel
int talker; // code for the device type
}EcDPT_type;
The defines for the bit mask combination of the data field available are as follows:
EC_DPT_DEPTH 1
EC_DPT_OFFSET (1<<1)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 271
$--DTM,ccc,a*hh<CR><LF>
1 2
The structure EcDTM_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec
// since 1.1.1970
char datumCode[4]; // 3 character datum code
char countryCode; // single character country code
int talker; // code for the device type
}EcDTM_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_DTM_DATUM_CODE 1
EC_DTM_COUNTRY_CODE (1<<1)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 272 18 Sensor Data
1 2 3 4 5 6 7 8 9 10
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 273
The structure EcGGA_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double latitude; // in degrees
double longitude; // in degrees
double altitude; // altitude of antenna
double horDilut; // horizontal dilution of prec.
double geoSep; // geoidal separation
double diffAge; // age of differential data
long timeOfPosition // milliseconds since midnight
int quality; // GPS quality indicator
int satInUse; // number of satellites in use
int refId; // reference station ID
int talker; // code for the device type
}EcGGA_type;
The defines for the bit mask combination of the data field available are as follows:
EC_GGA_FIXTIME 1
EC_GGA_LAT (1<<1)
EC_GGA_LON (1<<2)
EC_GGA_QUALITY (1<<3)
EC_GGA_USED_SATS (1<<4)
EC_GGA_HDOP (1<<5)
EC_GGA_ALTITUDE (1<<6)
EC_GGA_GEOSEP (1<<7)
EC_GGA_DIFF_AGE (1<<8)
EC_GGA_DIFF_REFID (1<<9)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 274 18 Sensor Data
Version 1.5:
$--GLL,llll.ll,a,yyyyy.yy,a*hh<CR><LF>
1 2
Version 2.0:
$--GLL,llll.ll,a,yyyyy.yy,a,hhmmss.ss,A*hh<CR><LF>
1 2 3 4
The structure EcGLL_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double latitude; // in degrees
double longitude; // in degrees
long timeOfPosition // milliseconds since midnight
int valid; // indicates if received data is valid
int talker; // code for the device type
double version; // version of GLL (1.5 or 2.0)
}EcGLL_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_GLL_LAT 1
EC_GLL_LON (1<<1)
EC_GLL_TIME (1<<2)
EC_GLL_VALID (1<<3)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 275
$--HDT,x.x,T*hh<CR><LF>
The structure EcHDT_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double heading; // 0..360 degrees
int talker; // code for the device type
}EcHDT_type;
The define for the bit mask combination of the data field available is as
follows:
EC_HDT_HEADING 1
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 276 18 Sensor Data
$--HDG,x.x,x.x,a,x.x,a*hh<CR><LF>
1 2 3
The structure EcHDG_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double heading; // heading in degrees
double deviation; // deviation in degrees,
// negative = westwards
double variation; // variation in degrees,
// negative = westwards
int talker; // code for the device type
}EcHDG_type;
The define for the bit mask combination of the data field available is as
follows:
EC_HDG_HEADING 1
EC_HDG_DEVIATION (1<<1)
EC_HDG_VARIATION (1<<2)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 277
$--MWV,x.x,a,x.x,a,A*hh<CR><LF>
1 2 3 4
The structure EcMWV_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double angle; // wind angle: 0..360 degrees
int reference; // angle is true or relative to ship
double speed; // wind speed in knots
int valid; // indicates if received data is valid
int talker; // code for the device type
}EcMWV_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_MWV_ANGLE 1
EC_MWV_ANGLE_REF (1<<1)
EC_MWV_SPEED (1<<2)
EC_MWV_VALID (1<<3)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 278 18 Sensor Data
$--OSD,x.x,A,x.x,a,x.x,a,x.x,x.x,a*hh<CR><LF>
1 2 3 4 5 6 7 8 9
The structure EcOSD_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double heading; // true heading: 0..360 degrees
int headingStatus; // indicates if heading is valid
double course; // true course: 0..360 degrees
int courseRef; // indicates if course is valid
double speed; // speed in knots
int speedRef; // type of speed reference
double set; // set: 0..360 degrees
double drift; // drift in knots
int talker; // code for the device type
}EcOSD_type;
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 279
The defines for the bit mask combination of the data field available are as
follows:
EC_OSD_HEADING 1
EC_OSD_HEADING_VALID (1<<1)
EC_OSD_COURSE (1<<2)
EC_OSD_COURSE_REF (1<<3)
EC_OSD_SPEED (1<<4)
EC_OSD_SPEED_REF (1<<5)
EC_OSD_SET (1<<6)
EC_OSD_DRIFT (1<<7)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 280 18 Sensor Data
$--RMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,xxxxxx,x.x,a*hh<CR><LF>
1 2 3 4 5 6 7 8
The structure EcRMC_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
int utc; // UTC of position fix HHMMSS
int status; // indicates if received data is valid
double latitude; // in degrees
double longitude; // in degrees
double speed; // speed in knots
double courseTrue; // true course: 0..360 degrees
int date; // date DDMMYY
double magVar; // magnetic variation in degrees
int talker; // code for the device type
}EcRMC_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_RMC_UTC 1
EC_RMC_STATUS (1<<1)
EC_RMC_LAT (1<<2)
EC_RMC_LON (1<<3)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 281
EC_RMC_SOG (1<<4)
EC_RMC_CMG (1<<5)
EC_RMC_DATE (1<<6)
EC_RMC_MAGVAR (1<<7)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 282 18 Sensor Data
$--ROT,x.x,A*hh<CR><LF>
1 2
1. Rate of turn in degrees per minute, ‘-‘ = bow turns to port. Stored in field
ROT.rate_of_turn.
2. Status - A = Data is valid. Stored in field ROT.valid.
The structure EcROT_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double rate_of_turn; // in degrees/minute
int valid; // indicates if received data is valid
int talker; // code for the device type
}EcROT_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_ROT_TURNRATE 1
EC_ROT_VALID (1<<1)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 283
RPM – Revolutions
Shaft or engine revolution rate, and propeller pitch.
$--RPM,a,x,x.x,x.x,A*hh<CR><LF>
1 2 3 4 5
1. Source, shaft(S)/engine(E).
2. Engine or shaft number, numbered from centerline, odd = starboard, even =
port, 0 = single or on centerline. Stored in field RPM.number.
3. Speed, revolutions per minute, ‘-‘ = counterclockwise. Stored in field
RPM.rpm.
4. Propeller Pitch, percent of maximum, ‘-‘ = astern. Stored in field
RPM.pitch.
5. Status - A = Data is valid. Stored in field RPM.valid.
The structure EcRPM_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
int source; // data source (shaft/engine)
int number; // source ID
double rpm; // revolutions per minute
// (‘-‘ = counterclockwise)
double pitch; // propeller pitch in percent (‘-‘ = astern)
int valid; // indicates if received data is valid
int talker; // code for the device type
}EcRPM_type;
The defines for the bit mask combination of the data field available are as follows:
EC_RPM_SOURCE 1
EC_RPM_NUMBER (1<<1)
EC_RPM_RPM (1<<2)
EC_RPM_PITCH (1<<3)
EC_RPM_VALID (1<<4)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 284 18 Sensor Data
$--RSA,x.x,A,x.x,A*hh<CR><LF>
1 2 3 4
The structure EcRSA_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double valueStb; // rudder angle sensor starboard (or single)
int stbValid; // indicates if received starboard value is
// valid
double valuePort; // rudder angle sensor port
int portValid; // indicates if received port value is valid
int talker; // code for the device type
}EcRSA_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_RSA_VALUESTB 1
EC_RSA_STB_VALID (1<<1)
EC_RSA_VALUEPORT (1<<2)
EC_RSA_PORT_VALID (1<<3)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 285
$--SNU,A*hh<CR><LF>
The structure EcSNU_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
int valid; // indicates if received data is valid
int talker; // code for the device type
}EcSNU_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_SNU_VALID 1
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 286 18 Sensor Data
$--TLL,xx,llll.ll,a,yyyyy.yy,a,c--c,hhmmss.ss,a,a*hh<CR><LF>
1 2 3 4 5 6 7
The structure EcTLL_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
int id; // target identifier
double latitude; // in degrees
double longitude; // in degrees
char userData[16]; // e.g. the target name
long timeOfPosition // milliseconds since midnight
int status; // indicates if target is Lost, Queried or
// Tracked
int referenceFlag; // indicates if target is a reference target
int talker; // code for the device type
}EcTLL_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_TLL_ID 1
EC_TLL_LAT (1<<1)
EC_TLL_LON (1<<2)
EC_TLL_USERDATA (1<<3)
EC_TLL_TIME (1<<4)
EC_TLL_STATUS (1<<5)
EC_TLL_TARGET_REF_FLAG (1<<6)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 287
$--TTM,xx,x.x,x.x,a,x.x,x.x,a,x.x,x.x,a,c--c,a,a,hhmmss.ss,a*hh<CR><LF>
1 2 3 4 5 6 7 8 9 10 11 12
The structure EcTTM_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
int id; // target identifier
double distance; // distance in nautical miles
double bearing; // bearing: 0..360 degrees
int bearingmode; // flag to indicate if true or relative bearing
double speed; // speed in knots
double course; // course: 0..360 degrees
int coursemode; // flag to indicate if true or relative course
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 288 18 Sensor Data
The defines for the bit mask combination of the data field available are as
follows:
EC_TTM_ID 1
EC_TTM_DISTANCE (1<<1)
EC_TTM_BEARING (1<<2)
EC_TTM_BEARING_TR (1<<3)
EC_TTM_TARGET_SPEED (1<<4)
EC_TTM_TARGET_COURSE (1<<5)
EC_TTM_TARGET_COURSE_TR (1<<6)
EC_TTM_CPA_DISTANCE (1<<7)
EC_TTM_CPA_TIME (1<<8)
EC_TTM_USERDATA (1<<9)
EC_TTM_TARGET_STATUS (1<<10)
EC_TTM_TARGET_REF_FLAG (1<<11)
EC_TTM_TIME (1<<12)
EC_TTM_TYPE (1<<13)
Additional defines used in this and the previous message (TTM and TLL) are:
EC_TARGET_LOST
EC_TARGET_QUERY
EC_TARGET_TRACKING
EC_TARGET_IS_NONREFERENCE
EC_TARGET_IS_REFERENCE
EC_ACQUISITIONTYPE_UNKNOWN
EC_ACQUISITIONTYPE_AUTOMATIC
EC_ACQUISITIONTYPE_MANUAL
Note:
The old version of this message (NMEA Version 2.00) can also be parsed with
the function EcSensorReadNmea(). The last two data fields UTC and
acquisition type which have been added in the new version of the message will
then be treated as no-data fields.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 289
1 2 3 4 5 6
The structure EcVBW_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since
// 1.1.1970
double waterSpeedL; // longitudinal water speed in knots
double waterSpeedT; // transverse water speed in knots
int waterSpeedValid; // indicates if received water speed is
// valid
double groundSpeedL; // longitudinal ground speed in knots
double groundSpeedT; // transverse ground speed in knots
int groundSpeedValid; // indicates if received ground speed
// is valid
int talker; // code for the device type
}EcVBW_type;
The defines for the bit mask combination of the data field available are as follows:
EC_VBW_WATERSPEED_L 1
EC_VBW_WATERSPEED_T (1<<1)
EC_VBW_WATERSPEED_VALID (1<<2)
EC_VBW_GROUNDSPEED_L (1<<3)
EC_VBW_GROUNDSPEED_T (1<<4)
EC_VBW_GROUNDSPEED_VALID (1<<5)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 290 18 Sensor Data
$--VHW,x.x,T,x.x,M,x.x,N,x.x,K*hh<CR><LF>
1 2 3 4
The structure EcVHW_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since
// 1.1.1970
double headingTrue; // true heading: 0..360 degrees
double headingMagnetic; // magnetic heading: 0..360 degrees
double speed; // speed in knots
int talker; // code for the device type
}EcVHW_type;
The defines for the bit mask combination of the data field available are as
follows:
EC_VHW_HEADING_T 1
EC_VHW_HEADING_M (1<<1)
EC_VHW_SPEED (1<<2)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 291
$--VTG,x.x,T,x.x,M,x.x,N,x.x,K*hh<CR><LF>
1 2 3 4
The structure EcVTG_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
double speed; // speed in knots
double courseTrue; // true course: 0..360 degrees
double courseMagnetic; // magnetic course: 0..360 degrees
int talker; // code for the device type
}EcVTG_type;
The defines for the bit mask combination of the data field available are as follows:
EC_VTG_COURSE_T 1
EC_VTG_COURSE_M (1<<1)
EC_VTG_SPEED (1<<2)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 292 18 Sensor Data
$--ZDA,hhmmss.ss,xx,xx,xxxx,xx,xx*hh<CR><LF>
1 2 3 4 5 6
The structure EcZDA_type and all its data fields are listed below:
typedef struct
{
int msgType; // message type
int available; // bit mask of filled data fields
time_t timestamp; // time when parsed: sec since 1.1.1970
time_t utc; // seconds since 1.1.1970
long zone_hour; // hours zone: -13..0..+13 hours
long zone_min; // minutes zone: 0..59 same sign as hours
// zone
int talker; // code for the device type
}EcZDA_type;
The defines for the bit mask combination of the data field available are as follows:
EC_ZDA_UTC 1
EC_ZDA_ZONE_H (1<<1)
EC_ZDA_ZONE_M (1<<2)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 293
18.2.1 Introduction
This document describes the application programming interface to use with an
AIS transponder system.
18.2.1.1 References
File ecKernel.h.
Document ITU-R M.1371-3 "Technical Characteristics for a Universal
Shipborne Automatic Identification System Using Time Division Multiple
Access in the VHF Maritime Mobile Band".
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 294 18 Sensor Data
Transponder
Transponder The application
sends Screen
displays the AIS
raw data informat ion
RS 232
graphically on
a screen
Application
t akes raw Application
dat a f or
f urt her
(e.g. ECDIS) AIS module w orks
comput ing
up the received
result and pro-
vides t he cont ent s
t o t he applicat ion
EC2007 ECDIS Kernel
Application
sends raw
dat a t o t he
AIS module AIS API ( AIS module)
DPI returns t he
result of the evalu-
Raw dat a is at ion t o t he API
parsed and
evaluat ed by
the driver Driver (AIS driver)
Programming
Interface
Figure 18.1: Flowchart showing how the AIS module is used within the ECDISenvironment to
process the raw transponder data.
The application reads data from the serial RS-232 interface to which the AIS
transponder is connected. These raw bytes are sent to the AIS module which calls
the hardware driver (DPI) to evaluate the received data. After the driver has
returned the result of the evaluation to the API the AIS module processes this
information and passes it on to the application which is now able to display on the
screen AIS targets and messages, both addressed and broadcast.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 295
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 296 18 Sensor Data
EcGPSType
Enumeration to select internal/external GPS usage.
EcGPSt_undefined
Undefined GPS usage.
EcGPSt_externalGPS
Use external GPS.
EcGPSt_internalGPS
Use internal GPS.
EcAISMessageType
Enumeration to identify the type of a message. Values defined as follows:
EmsgT_undefined
Undefined message type.
EMsgT_unknown
Message is of unknown type and must be evaluated by the user.
eMsgT_addressed
The message has been received / is to be sent as addressed, i.e. it was
sent by an AIS target / an AIS equipped vessel specified by its MMSI
number to a destination specified by another MMSI number.
eMsgT_broadcast
The message has been received / is to be sent as broadcast, i.e. that a
broadcast message has been received / that all AIS targets within range
will receive this message.
eMsgT_acknowledgement
The message is an acknowledgement for a previously received message.
eMsgT_noMessage
There was no message in the queue.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 297
EcAISNavStatus
Navigational Status of an AIS target. Values defined as follows:
eNavS_undefined
Undefined navigation status.
eNavS_underWay
Ship is under way.
eNavS_atAnchor
Ship is at anchor.
eNavS_notUnderCommand
Ship is not under command.
eNavS_restrManoeuvr
Ship has restricted manoeuvrability.
eNavS_draughtConstrained
Constrained manoeuvrability due to draft.
eNavS_moored
Ship is moored.
eNavS_aground
Ship is aground.
eNavS_fishing
Ship is fishing.
eNavS_sailing
Ship is sailing.
eNavS_emergency
Ship is in a state of emergency.
eNavS_baseStation
Indicates a base station.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 298 18 Sensor Data
EcAISPosAccuracy
Accuracy of reported position. Values defined as follows:
ePosA_undefined
Indicates that position accuracy is not available.
ePosA_high
Accuracy <10m due to usage of DGNSS receiver.
ePosA_low
Accuracy >10m due to autonomous mode of GNSS receiver.
EcAISNavSensorType
Indicates the type of navigational sensor:
eNSTy_undefined
eNSTy_gps
eNSTy_glonass
eNSTy_combGpsGlonass
eNSTy_loranC
eNSTy_chayka
eNSTy_integratedNavSystems
eNSTy_surveyed
eNSTy_other
EcAISNavSensorStatus
Indicates the status of navigational sensor:
posSensor_undefined
posSensor_operating
posSensor_manual
posSensor_deadReckoning
posSensor_inoperative
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 299
EcAISMessage
Structure to hold type of message and message text/contents.
EcAISMessageType type
The type of message that has been received / is to be sent (values see
chapter 18.2.4.1, “EcAISMessageType”).
EcAISTime
Universal Time format.
Bool valid
Indicates validity of data.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 300 18 Sensor Data
EcAISAntennaPos
Position of the antenna on the ship.
unsigned short a
Distance bow - antenna, range: 0 to 511 m.
unsigned short b
Distance stern - antenna, range: 0 to 511 m.
unsigned char c
Distance port-side - antenna, range: 0 to 63 m.
unsigned char d
Distance starbord - antenna, range: 0 to 63 m.
Bool valid
Indicates validity of data.
EcAISEta
Estimated time of arrival.
Bool valid
Indicates validity of data.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 301
EcAISTargetInfo
Structure to hold informational data on vessels/base stations.
Bool ownShip
Flag indicating if target is from own or other ship.
EC_AIS_INVALID_MMSI indicates invalidity.
EcAISNavStatus navStatus
The navigational status of the AIS target (values see chapter 18.2.4.1,
“EcAISNavStatus”).
int rot
Rate of turn [1/10 °/min]; Values range from -720 to +720 °/min.
EC_AIS_INVALID_ROT indicates “not available”.
EcAISPosAccuracy posAccuracy
The accuracy of the position report (values see chapter 18.2.4.1,
“EcAISPosAccuracy”).
int longitude
Longitude of AIS target [1/10000 min], >=0: East, <0: West.
EC_AIS_INVALID_LAT indicates “not available”.
int latitude
Latitude of AIS target [1/10000 min], >=0: North, <0: South.
EC_AIS_INVALID_LON indicates “not available”.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 302 18 Sensor Data
char callSign[EC_AIS_CALL_SIGN_LEN]
The call sign of the vessel.
A string of length zero indicates “not available”.
char vendorID[EC_AIS_CALL_SIGN_LEN]
Vendor ID parsed in message 24.
char shipName[EC_AIS_SHIP_NAME_LEN]
The ship's name.
A string of length zero indicates “not available”.
EcAISAntennaPos antennaPosition
Position of the antenna relative to the ships outline (see chapter 18.2.4.2,
“EcAISAntennaPos”).
EcAISNavSensorType navSensorType
Indicates type of navigational sensor.
EcAISNavSensorStatus navSensorStatus
Indicates status of navigational sensor.
EcAISActivationStatus activationStatus
Indicates activation status.
EcAISTrackingStatus trackingStatus
Indicates tracking status.
char navName[EC_AIS_NAV_NAME_LEN]
Name of Aids-to-navigation. Only in message 21.
EcAISEta eta
Represents estimated time of arrival (see chapter 18.2.4.2, “EcAISEta”).
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 303
char destination[EC_AIS_DESTINATION_LEN]
Name of destination port.
A string of length zero indicates “not available”.
EcAISTime lastSysTimeOfReport
System time when last position telegram was received (see chapter
18.2.4.2, “ECAISTime”).
time_t parseTime
Time the message was parsed. Number of seconds elapsed since
midnight (00:00:00), January 1, 1970; Coordinated Universal Time
(UTC), according to the system clock.
EcAISTime lastUtcTimeFromTarget
Last UTC time received from the AIS target (see chapter 18.2.4.2,
“ECAISTime”).
General Annotations
The functions are designed to always return a Bool value. This is to let the user
easily determine whether a function has failed. In general a value of FALSE is
returned in case an invalid pointer has been encountered. Otherwise the return
value is determined internally through the functions algorithm. The user can
retrieve an error message by calling EcAISGetLastErrorText().
Functions:
EcAISQueryTransponderInfoString
Query manufacturer defined description string of the DPI module (shared library).
Prototype: Bool EcAISQueryTransponderInfoString(
char *infoString,
uint len,
const char *moduleFileName,
EcGPSType type)
Parameters:
infoString char array to return the manufacturer's
description string
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 304 18 Sensor Data
EcAISNewTransponder
Get pointer to new transponder object.
Prototype: Bool EcAISNewTransponder(
EcAISTransponder **transponder,
const char *moduleFileName)
Parameters:
transponder reference to a pointer of an
EcAISTransponder object
moduleFileName filename of module to use as parser for the
transponder's messages
type select internal/external GPS usage
This function is used to create a new EcAISTransponder object and associate a
driver with it. If moduleFileName names a valid DPI module it is associated
with the newly created EcAISTransponder object, and then used to parse the
bytestream that is read from the transponder hardware. In this case TRUE is
returned. Otherwise FALSE is returned and a NULL value is assigned to
*transponder. The returned pointer must be released with
EcAISDeleteTransponder().
EcAISDeleteTransponder
Release pointer to transponder object.
Prototype: Bool EcAISDeleteTransponder(
EcAISTransponder **transponder)
Parameters:
transponder reference to a pointer of an
EcAISTransponder object
This function is used to release a formerly created EcAISTransponder object. A
NULL value is assigned to *transponder after the object has been released. On
success TRUE is returned.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 305
EcAISBuildInitMessage
Build transponder message to initialize the transponder hardware.
Prototype: Bool EcAISBuildInitMessage(
EcAISTransponder *transponder,
byte *tMsg,
uint tMsgSize,
uint *tMsgLen)
Parameters:
transponder pointer to an EcAISTransponder object
tMsg array that will contain the raw initialization
message which can be directly sent to the
transponder
tMsgSize length of the tMsg array
tMsgLen length of the generated transponder
message
This function must be called immediately after creating a transponder object
through EcAISNewTransponder. The init message then must be sent to the
transponder hardware.
EcAISBuildReleaseMessage
Build transponder message to release the transponder hardware.
Prototype: Bool EcAISBuildReleaseMessage(
EcAISTransponder *transponder,
byte *tMsg,
uint tMsgSize,
uint *tMsgLen)
Parameters:
transponder pointer to an EcAISTransponder object
tMsg array that will contain the raw data release
message which can be directly sent to the
transponder
tMsgSize length of the tMsg array
tMsgLen length of the produced transponder message
This function must be called just before deleting a transponder object through
EcAISDeleteTransponder(). The release message must then be sent to the
transponder hardware.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 306 18 Sensor Data
EcAISAddTransponderOutput
Add output read from serial interface of transponder to the library's data queue.
Prototype: Bool EcAISAddTransponderOutput(
EcAISTransponder *transponder,
const char *byteStream,
uint len)
Parameters:
transponder pointer to an EcAISTransponder object
byteStream byte stream that has been read from the
serial interface to a transponder
len length of the byte stream
This function must be called to process data that have been read from the
transponder hardware. After a specific amount of bytes has been received the
parser of the DPI is called internally, and the message queue and AIS target list
are updated. If the bytestream has been stored successfully in the internal queue
TRUE will be returned, FALSE otherwise.
EcAISGetTargetInfo
Get information of specific AIS target.
Prototype: BOOL EcAISGetTargetInfo(
EcAISTransponder *transponder,
uint mmsi,
EcAISTargetInfo *targetInfo)
Parameters:
transponder pointer to an EcAISTransponder object
mmsi MMSI number of requested AIS target
EcAISTargetInfo pointer to a structure where the information
shall be stored
This function is called to get information on an AIS target specified by its MMSI
number. If the target is known TRUE is returned and the targetInfo structure is
filled appropriately, otherwise FALSE is returned.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 307
EcAISGetTargetInfoArray
Get pointer to an array of all available AIS targets.
Prototype: BOOL EcAISGetTargetInfoArray(
EcAISTransponder *transponder,
EcAISTargetInfo **infoArray,
uint *numTargets)
Parameters:
transponder pointer to an EcAISTransponder object
infoList reference to a pointer to an
EcAISTargetInfo Structure array where the
information about the targets will be stored
numTargets number of EcAISTargetInfo structures in
the infoList
This function generates an array of all AIS targets that have been identified. The
function internally allocates the memory for the infoList. The user must call
EcAISReleaseTargetInfoArray() to release the memory when it is no
longer needed. On success TRUE is returned, FALSE otherwise.
EcAISReleaseTargetInfoArray
Release pointer to an array of AIS targets.
Prototype: BOOL EcAISReleaseTargetInfoArray(
EcAISTransponder *transponder,
EcAISTargetInfo **infoArray)
Parameters:
transponder pointer to an EcAISTransponder object
infoList reference to a list of EcAISTargetInfo
structures that is no longer needed
This function must be called to release a formerly allocated array of
EcAISTargetInfo structures. On success TRUE is returned, FALSE otherwise.
EcAISRemoveTarget
Prototype: BOOL EcAISRemoveTarget(
EcAISTransponder *transponder,
uint mmsi)
Parameters:
transponder pointer to an EcAISTransponder object
mmsi MMSI number of the target to be deleted
from the internal list
This function is called to delete an AIS target specified by its MMSI number from
the internal list of AIS targets.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 308 18 Sensor Data
EcAISGetMessage
Get the last message out of the received message queue.
Prototype: BOOL EcAISGetMessage(
EcAISTransponder *transponder,
EcAISMessage *msg)
Parameters:
transponder pointer to an EcAISTransponder object
msg pointer to an EcAISMessage structure
where the last message will be stored in
EcAISCreateBinaryMsg
Send an addressed or broadcast message through transponder interface.
Prototype: BOOL EcAISCreateBinaryMsg(
EcAISTransponder *transponder,
byte *tMsg,
uint tMsgSize,
uint *tMsgLen,
const EcAISMessage *msg)
Parameters:
transponder pointer to an EcAISTransponder object
tMsg array that will contain raw data which can
be directly sent to the transponder
tMsgSize length of the tMsg array
tMsgLen length of the produced transponder message
msg pointer to an EcAISMessage structure that
describes the message to be sent
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 309
EcAISSetVesselData
Set dynamic and static information of own ship.
Prototype: BOOL EcAISSetVesselData(
EcAISTransponder *transponder,
const EcAISTargetInfo *info)
Parameters:
transponder pointer to an EcAISTransponder object
info pointer to an EcAISTargetInfo structure
that contains all information about the own
ship
This function is called to set information about the own vessel. Only valid fields
are copied internally so that static information need only be set once or only a
subset of information may be updated. Dynamic position information must be set
at least once a second since there exist time-out values in the transponder
hardware. On success TRUE is returned, FALSE otherwise.
EcAISCreateOwnDynamicInfoMsg
Create own position message in transponder format.
Prototype: BOOL EcAISCreateOwnDynamicInfoMsg(
EcAISTransponder *transponder,
byte *tMsg,
uint tMsgSize,
uint *tMsgLen)
Parameters:
transponder pointer to an EcAISTransponder object
tMsg byte array that will contain the raw
transponder message
tMsgSize length of the tMsg array
tMsgLen length of the produced position message
This function is called to produce a raw transponder message that can be sent
directly to the transponder. It contains information about the own ship’s position,
speed, etc., depending on the information that has been given through
EcAISSetVesselData(). This function must be called according to the table
below. If the message can be produced TRUE is returned, FALSE otherwise.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 310 18 Sensor Data
EcAISCreateOwnStaticInfoMsg
Create static information message in transponder format.
Prototype: BOOL EcAISCreateOwnStaticInfoMsg(
EcAISTransponder *transponder,
byte *tMsg,
uint tMsgSize,
uint *tMsgLen)
Parameters:
transponder pointer to an EcAISTransponder object
tMsg byte array that will contain the raw
transponder message
tMsgSize length of the tMsg array
tMsgLen length of the created static information
message
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
18 Sensor Data Page 311
EcAISGetLastErrorText
Get text of last error encountered.
Prototype: BOOL EcAISGetLastErrorText(
EcAISTransponder *transponder,
char *errText,
uint size)
Parameters:
transponder pointer to an EcAISTransponder object
errText pointer to char array where to store the
error text
size size of the errText array
This function provides an interface to the internal error status. It always returns a
c-string (zero-terminated) of the last error encountered, and is reset to “no error”
status when called. The errText array should have a length of at least
ECI_AIS_MAX_ERR_TXT_LEN.
18.2.5 Acronyms
AIS Automatic Identification System
DGNSS Differential GNSS
DGPS Differential GPS
DPI Driver Programming Interface
GNSS Global Navigation Satellite System
GPS Global Positioning System
ITU International Telecommunication Union
ITU-R ITU Radio Communications
MMSI Maritime Mobile Service Identity
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 312
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 313
19 Software Registration
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 314 19 Software Registration
in the first dialogue. The Kernel verifies the key, and a valid key is stored
permanently in the system.
This kind of registration is needed to enable some privileged Kernel functions,
which access protected chart data. The Kernel may be used without a valid
registration for a limited time period called Registration Period (28 days). During
this period, all non-privileged Kernel functions are available but access to
protected chart data is denied. If no valid Registration Key is entered all functions
of the Kernel will be disabled upon expiration of the Registration Period.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 315
Starting with Kernel 5.2 a new concept is introduced. Now there is only one
module, the Main Module.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 316 19 Software Registration
The other formerly called "Modules" are now called "Options” to distinguish
them from the Main Module.
Vector Data
GEOSYM GEOSYM GEOSYM AML
PresLib PresLib PresLib PresLib
ARCS
ARCS
Option
VPF-
Import VPF
directENC
PresLib
Editor Customized Inland
PresLib PresLib
Custom Inland ECDIS
S57 S52 Protected
Option Option against
Dictionary PresLib
Dictionary Customized Inland Modification
Editor Dictionary Dictionary
License
required
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 317
The Display Options are required to read the data product specific dictionaries,
whereas the Import Options are more generic and require the registration of one of
the Display Options (the S57 Display Option is included in the Main Module).
As it has been before the Main Module is always required for an application to
run. It includes the import and display of directENC data, the display of S57 data,
and the display of BSB raster charts (BSB on Windows systems only).
Compared to the old Module concept one major difference is that the import and
display functionalities for S57 and VPF based vector data are now covered by
separate Options.
To import S57 data an application needs the Main Module plus the S57 Import
Option.
To display S57 data, only the Main Module is required since it includes the S57
Display Option.
To import VPF based data (e.g. DNC) an application needs the Main Module, the
VPF Import Option, and the corresponding Display Option (in this example,
DNC).
Old Registration Keys are transformed automatically by Kernel 5.2. Thus no
functionality will be lost. This means that an old DNC Module registration is
automatically transformed into the new VPF Import and DNC Display Options.
The former Primar Module has been discontinued. The functionality for importing
S-63 encrypted data is now included in the S57 Import Option. No changes have
been made to the ARCS Module, it is just called Option now.
Structure and handling of the object and attribute catalogues (also called
dictionaries) has been completely re-designed for Kernel Version 5.2 in order to
reflect the new concept of Kernel Options.
PPPXXLLD.7DI
Since there are some Display Options which require more than one dictionary, a
new Kernel function has been introduced which automatically merges all required
files: EcDictionaryReadModule().
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 318 19 Software Registration
Note:
It is strongly recommended to use the new function! Only where special (user
or manufacturer defined) dictionaries must be used in an application the old
function EcDictionaryReadExt() should still be used.
When a dictionary is read the Kernel checks whether the corresponding Display
Option has been registered.
Main Module
ENC20ENO.7DI / ENC20ENA.7DI (ENC)
S5731ENO.7DI / S5731ENA.7DI (S57 use for ENCs prohibited)
MIO32ENO.7DI / MIO32ENA.7DI (S52, mariners objects)
7CS10ENO.7DI / 7CS10ENA.7DI (SevenCs, Applications, Customers)
NAV10ENO.7DI / NAV10ENA.7DI (Navionics)
ICE10ENO.7DI / ICE10ENA.7DI (Ice)
WTH10ENO.7DI / WTH10ENA.7DI (Weather)
Inland Option
INL10ENO.7DI / INL10ENA.7DI (InlandECDIS)
DNC Option
TD010ENO.7DI / TD010ENA.7DI (TOD0)
TD110ENO.7DI / TD110ENA.7DI (TOD1)
TD210ENO.7DI / TD210ENA.7DI (TOD2)
TD410ENO.7DI / TD410ENA.7DI (TOD4)
VMAP Option
VMP10ENO.7DI / VMP10ENA.7DI (VMAP0/1)
AML Option
AMLMFF10ENO.7DI / AMLMFF10ENA.7DI (AML Version 1 MFF)
AMLRAL10ENO.7DI / AMLRAL10ENA.7DI (AML Version 1 RAL)
AMLLBO10ENO.7DI / AMLLBO10ENA.7DI (AML Version 1 LBO)
AMLCLB10ENO.7DI / AMLCLB10ENA.7DI (AML Version 1 CLB)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 319
In order to load all required dictionaries for one or more Display Options, call
EcDictionaryReadModule() with the identifiers of the selected Options.
Examples:
To load the dictionaries for S57, call
EcDictionaryReadModule(EC_MODULE_MAIN, stderr);. This is
equivalent to the call EcDictionaryReadExt("objcatv3.dic",
"atrcatv3.dic", stderr); in older Kernel versions.
To load the dictionaries for DNC and VMAP, call
EcDictionaryReadModule(EC_MODULE_DNC | EC_MODULE_VMAP,
stderr);.
To check whether an Option has been registered for your application you can use
EcKernelRegisterTestModule() with one of the following identifiers (as
defined in eckernel.h):
EC_MODULE_S57_IMPORT
EC_MODULE_VPF_IMPORT
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 320 19 Software Registration
EC_MODULE_DNC
EC_MODULE_VMAP
EC_MODULE_LWD
EC_MODULE_AML
EC_MODULE_INLAND
EC_MODULE_CUSTOM
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 321
Start application
that invokes the
Release Kernel
Registration
dialogue appears,
showing the hardware
identification string
Register
NO
application
?
YES
Look up your
registration permit
Contact 7Cs
to retrieve the
registration key(s)
Enter the
registration key
in the dialogue
Registration NO
key
accepted
?
YES
Standard NO
registration
mode?
YES
Access to encrypted
information enabled
Registration keys
permanently stored
NO Registration
Kernel functions
operational period (28 days)
expired
?
YES
Kernel functions
disabled
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 322 19 Software Registration
For Windows platforms the dongle driver can be installed automatically by the
Kernel setup program.
Under Linux the dongle driver must be installed manually to enable recognition of
the dongle. Moreover, it is recommended to refer to the file INST_DONGLE.TXT
for detailed information about the installation of the dongle driver under Linux.
By default the Kernel registration is based on the hard disk. That is why the
dongle registration must be initialized by the application before the Kernel can
recognize the dongle. An application that is to use a dongle for the Kernel
registration must pass on to the Kernel the information which dongle type is
expected. The standard dongle provided by SevenCs is dongle type 7.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 323
// set the environment for the Kernel before calling this function, but do not
// call any other Kernel function!
...
int status;
bool ret;
EcKernelRegisterSetMode(EC_REGISTER_CHECK_DONGLE_7);
ret=EcKernelRegisterGetStatus(&status);
if (!ret)
{
// Kernel has not been registered or the dongle is not in place
// Application should terminate
...
}
...
Tip:
The sample tool ‘register’ that comes with the Kernel delivery can be used to
facilitate the registration procedure with or without dongle. See the following
chapter 19.4 The Register Tool for more information.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 324 19 Software Registration
The environment variables LIB_7CS and CFG_7CS must be set before the tool is
started. LIB_7CS must be set to the path that contains the /lib directory with
the Kernel library files (i.e. config, fonts, objcat and preslib4). CFG_7CS must be
set to a path on a local disk.
If, for example, the directory structure of the library files is as follows:
c:\home\ecdis\lib\config\
c:\home\ecdis\lib\fonts\
c:\home\ecdis\lib\objcat\
c:\home\ecdis\lib\preslib4\
then set LIB_7CS= c:\home\ecdis
For further information on the setting of the environment and the directory
structure refer to chapter 3 Installation and Configuration.
Note:
You can use these options only to set the environment for the current session.
The settings will not be stored after register is closed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 325
Note:
Every new registration key is linked to a new registry licence which will be
charged.
Usage :
register [-l|c path] [-d|n] [-o|f] [-h]
Examples:
register -c c:\home\ecdis
sets CFG_7CS = c:\home\ecdis
register -o
displays default hardware ID (no registration dialogue)
register –o –n
displays hardware ID based on network card (no registration dialogue)
register –f –n
deletes current registry entries, and calls registration dialogue (hardware ID
derived from network card)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 326 19 Software Registration
19.4.3 Troubleshooting:
Error message: Hardware ID not available
Windows Dialogue:
The system hardware information required by SevenCs EC2007 ECDIS Kernel
Registration is not available.
If this error messages is displayed please check whether EC2007SERVICE is
running. Use the Windows Services dialogue (access via the control panel) to
view EC2007SERVICE status and its version.
In case of problems concerning EC2007SERVICE run regTest.exe
(LIB_7CS\kernel\lib\winnt). This will install the latest version, start the
Service and replace older versions of the Service. A check whether the hardware
ID can be determined will be carried out, and a dialogue will display the result of
a hardware check. Please report error messages to SevenCs
(support@sevencs.com) in case the hardware check should fail.
If the error message ‘Hardware ID not available’ is displayed please check the
following:
There must be a file called EcRegMsg in the directory
LIB_7CS/lib/config.
If the environment variable CFG_7CS is set to a path other than
LIB_7CS/lib/config move EcRegMsg to the directory CFG_7CS is set to.
If CFG_7CS is not set EcRegMsg must be in the directory
LIB_7CS/lib/config.
Concerning the rights for EcRegMsg both User and Group must be set to root,
the user ID flag must be set and EcRegMsg must be executable for all users
(-rwsr-sr-x root root).
Concerning the directory containing EcRegMsg (i.e. the directory
LIB_7CS/lib/config, or the directory CFG_7CS is set to) the user must
have executable rights.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 327
Note:
For each e-mail multiple registrations are possible, but only for one permit.
To receive registration strings from the Registry Robot your e-mail should contain
the following information:
your return path (in the e-mail header)
name of the vessel where the software will be installed (optional parameter,
may be blank)
company acronym and permit (make sure that the format is correct)
at least one hardware ID
The permit and the hardware ID(s) should be separated by carriage return, or by
comma.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 328 19 Software Registration
To: registry@sevencs.com
From: <your e-mail address>
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
19 Software Registration Page 329
As a new feature the registry robot now provides a licence file that can be used to
perform an automatic registration of the Kernel without user interaction. For more
information see chapter 19.7 below.
LIB_7CS/lib/config/license.upd
or
CFG_7CS/license.upd
in case CFG_7CS has been defined.
The licence file is searched for an entry matching the current HardwareId of the
Kernel. If a matching entry is found then all related keys will be installed
automatically.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 330 19 Software Registration
File Format
Licence files are simply text files containing some keywords, related keys and text
information. The following example displays all keywords and keys in bold font.
Note:
These entries MUST NOT be changed.
[7674-9CD8-53C9-2A61-257C-A]
RegKey: A6C7-6D57-B1BB-FA69-257C
RegKey2: 035A-D4E2-CE99-34E1-257C
RestPerm: 8C98-05B9-AD02-189E
ModKey: 3FB7-220D-C1DB-F2E7-29E8
EvalKey:
# optional entries
Date: 20100520
Permit:
ShipName:
ArcsPin: 1122
ArcsPerm: D20F60FA913E3743
[ ]
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 331
20 Appendices
Besides general software maintenance, such as the support of new data products
or product versions, minor functionality changes, and bug fixes the two major
changes in the new 5.12 kernel version are:
API extensions to support the distribution of official ENCs in SevenCs SENC
format (directENC) by ChartWorld GmbH, our chart agent subsidiary, and
the integration of an efficient memory management.
The first change allows our OEMs to load official ENCs not only in normal S-63
format but, in case the data is supplied by ChartWorld, also in the SevenCs SENC
format (directENC). The main advantages of this are simplified chart handling
and a much faster chart loading process.
The second change is the first step in an ongoing programme to update the
SevenCs EC2007 Kernel to improve performance and to take advantage of the
latest generation of multi-core processors.
Note:
Version 5.12 of the EC2007 ECDIS Kernel
- has got a new application ID. Therefore older applications have to be re-
registered if they have been updated with version 5.12 of the EC2007
ECDIS Kernel. To prevent any influence of the end user a new method of
licence handling has been introduced. For more details see chapter
19.7 Automatic Registration.
- cannot be used on Virtual Machines by default. This capability is only
available on request.
- does not contain the application ChartHandler anymore. Instead, the
respective chart handling functions should be used. They have been
extended and improved.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 332 20 Appendices
20.1.1.4 MIL-2525
The MIL-2525 standard for common warfighting symbology according to version
B, Change 2 is now supported, but limited to the UIE (Units, Installations and
Equipment) objects. If there is sufficient user demand this capability will be
extended.
Please note that this functionality is provided as an independent software package
on request.
20.1.2 Modules
As a complement to the extension of the Kernel main module for SENC import
the S-57/S-63 module is not required anymore for import and application of
unencrypted S-57 chart update files.
20.1.3 Functionality
20.1.3.1 S-63 / SENC Data Handling
A new function set was introduced to simplify not only handling of S-63 data, i.e.
Exchange Sets and Permits, but also the new SevenCs SENC (directENC)
exchange set format.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 333
20.1.3.3 ARCS
Multi panel ARCS charts are now supported in mixed mode (ENC/ARCS).
20.1.3.4 AIS
The AIS message type 9 (Standard SAR aircraft position report) and the class B
specific message types 18, 19 (standard and extended class B equipment position
report) and 24 (aids to navigation report) are now supported.
20.1.3.10 3D Display
The redesigned 3D library now supports not only S-57 data but also DTED
(Digital Terrain Elevation Data) and BAG (Bathymetric Attributed Grid Object)
data. The 3D Library is based on OpenSG.
Note:
The 3D library is only available for Windows.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 334 20 Appendices
image
6. Fonts were not loaded correctly in X11.
7. During manual updating some log messages were not written to the history
file.
8. Wrong coverage calculation in case of “donut” coverage in VPF data.
20.1.5.1.1 General
New function EcDENCPackageAddCellReferences to create the reference
of a cell to directENC packages without having to rebuild the archive.
New function EcDENCGetInstalledPACEntries to query the installed
producer agency code entries.
New function EcChartSetCellNameLoadFilter to filter cells based on
the name (e.g. cells of a certain Chart Package).
Bug fix for the application of S-57 update files which contain wrecks (WRECKS),
obstructions (OBSTRN) or underwater rocks (UWTROC). In particular cases the
application of those updates lead to an incorrect display.
Changed function EcChartSetCellLoadFilter. It now accepts empty lists
of products and producer codes.
New function set EcDENCExchangeSet* to support SENC exchange sets. The
existing function EcDENCImportS57ExchangeSet now supports SENC
exhange sets as well. Please refer to chapter 11.5 of the programming guide.
New function set EcChartPermit* to simplify chart permit handling. Please
refer to chapter 11.6 of the programming guide.
New function set EcS63* to simplify S-63 data and permit handling. Please refer
to chapter 9.3 of the programming guide.
20.1.5.1.2 ENC
On export from SENC to S-57 the prefix CNAME is no longer written to the
COMT field of the cell header.
20.1.5.1.3 ARCS
New functions EcArcsFindChart and EcArcsCreateCatalogue,
changed functions EcArcsApplyUpdate, EcArcsInstallChart, and
EcArcsDeleteChart in order to maintain a catalogue containing all ARCS
charts with their coordinates in WGS84.
New functions EcArcsInitChartsQuick,
EcArcsInitChartsWithoutPlansQuick and
EcArcsChartPermitIsAvailableQuick to read a minimum of
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 335
20.1.5.2.1 General
New functions EcDrawSetLoxodromeStrait and
EcDrawGetLoxodromeStrait.
New function EcDrawGetSymbolClipBox to get a special clip box for
centred symbols.
New function EcDrawNTDrawSimpleAreaText to draw a text for a given
area primitive using the provided symbolization instruction.
New functions EcDrawSetTextSizeLimits and
EcDrawGetTextSizeLimits to handle minimum and maximum text size in
pica points.
New functions EcDrawSetTextQuality and EcDrawGetTextQuality
to handle a quality hint for the font server (Windows only). This allows to disable
the font anti-aliasing.
Standard font for Unicode text display changed from "Lucida Sans Unicode" to
"Arial Unicode MS".
New function EcDrawNTInitializeExt to activate alpha blending for
Windows GDI. Once initialized, subsequent calls of EcDrawNTInitialize
keep this value. The function checks if the graphic system supports alpha blending
and if the corresponding DLL is available. Furthermore the drawing area must
have 24 bits colour depth. Otherwise alpha blending is not activated.
New projection type for UTM (EC_GEO_PROJECTION_UTM_EXT) to support
spheroid independent UTM.
New projection type for polar stereographic
(EC_GEO_PROJECTION_POLAR_STEREOGRAPHIC_EXT) to support the
variants A, B and C.
New functions EcDrawGetDatum and EcDrawGetSpheroid to get the
datum and the spheroid from the view.
New function EcChartsSymbolizeCells to symbolize a list of cells.
New functions EcCellGetBestScaleAtPosition,
EcCellGetBestUsageAtPosition, EcDrawSetOverscaleUsage and
EcDrawSetOverscaleUsage to improve overscale pattern handling.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 336 20 Appendices
20.1.5.2.3 ENC
Textgroup light names (LIGHTS) changed to 26. Now these texts can be switched
on/off using EcChartSetShowText.
Bug fix in the display of areal underwater hazards. The radar image was
suppressed by these objects.
20.1.5.2.4 IENC
New functions EcRuleSetNoticeMarkMode,
EcRuleSetNoticeMarkMode, EcRiverChartSetNoticeMarkMode
and EcRiverChartSetNoticeMarkMode to support different displays of
notice marks, i.e. the generic or the “real world” display. For the “real world”
display a new symbol set has been introduced.
20.1.5.2.5 bENC
In bathymetric mode the contour lines of the ENC were still displayed in the
bENC area.
20.1.5.2.6 GeoSym
Bug fix in the display of masked edges in VPF data.
Enhanced GeoSym display. Different depth units in VPF data are now supported.
The alignment of depth contour labels was improved.
20.1.5.3 Miscellaneous
New function EcChartGetErrorLog to retrieve the error log file for the given
view.
Enhanced handling of AIS sensor values, i.e. special treatment of unavailable AIS
values.
Bug fix in radar drawing function when displaying cells of different priorities (e.g.
official and non-official) in one usage. Cells with lower priority could be drawn
on top of cells with higher priority in the over-radar part.
New functions EcDrawX11SetScreen and EcDrawX11GetScreen to
handle more than one screen implemented. The View members EcDisplay and
EcScreen are now initialized to NULL resp. -1. The screen number has to be set
before calling EcDrawX11Initialize. Each screen should use its own view.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 337
EcArcsChartPermitIsAvailableQuick
EcArcsCreateCatalogue
EcArcsFindChart
EcArcsGetShowDemoMessage
EcArcsInitChartsQuick
EcArcsInitChartsWithoutPlansQuick
EcArcsSetShowDemoMessage
EcBSBGetChartEditionDate
EcCellCreateExt
EcCellGetBestScaleAtPosition
EcCellGetBestUsageAtPosition
EcCellGetChartPermitList
EcCellGetProductId
EcCellSetChartPermitList
EcChartAddPermit
EcChartAppendLookupTable
EcChartClearLookupTable
EcChartCreateLookupTable
EcChartDeleteAllPermits
EcChartDeleteLookupTable
EcChartDeletePermit
EcChartFilterAllObjectsExt
EcChartFilterObjectClassExt
EcChartGetAllPermits
EcChartGetCellLoadFilter
EcChartGetCellNameLoadFilter
EcChartGetErrorLog
EcChartGetFilteredObjectClassesExt
EcChartGetLookupEntryExt
EcChartGetPermitsByCellId
EcChartGetPermitsByName
EcChartGetShowAdmiraltyOverlay
EcChartGetSimpleIsolatedDangers
EcChartGetSymbAllTimeLabels
EcChartPermitListCreate
EcChartPermitListDelete
EcChartSetCellNameLoadFilter
EcChartSetObjectFilterCallbackExt
EcChartSetShowAdmiraltyOverlay
EcChartSetSimpleIsolatedDangers
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 338 20 Appendices
EcChartSetSymbAllTimeLabels
EcChartSymbolizeCellExt
EcChartSymbolizeCells
EcChartSymbolizeCellsExt
EcChartViewGetDictionary
EcDENCExchangeSetFreeCatalog
EcDENCExchangeSetGetComment
EcDENCExchangeSetGetEntry
EcDENCExchangeSetGetNumberOfEntries
EcDENCExchangeSetGetRootPath
EcDENCExchangeSetGetType
EcDENCExchangeSetReadCatalog
EcDENCGetExchangeSetType
EcDENCGetInstalledPACEntries
EcDENCPackageAddCellReferences
EcDictionaryProductGetCatalogues
EcDrawGetDatum
EcDrawGetFixedCenteredSymbols
EcDrawGetLoxodromeStrait
EcDrawGetOverscaleUsage
EcDrawGetSpheroid
EcDrawGetSymbolClipBox
EcDrawGetTextQuality
EcDrawGetTextSizeLimits
EcDrawNTDrawDisplayList
EcDrawNTDrawPrimitive
EcDrawNTDrawSimpleAreaText
EcDrawNTDrawSimpleLineText
EcDrawNTDrawSimplePointText
EcDrawNTInitializeExt
EcDrawNTSetColorSchemeExt
EcDrawRenderPrimitive
EcDrawSetFixedCenteredSymbols
EcDrawSetLoxodromeStrait
EcDrawSetOverscaleUsage
EcDrawSetProjectionExt
EcDrawSetTextQuality
EcDrawSetTextSizeLimits
EcDrawX11DrawDisplayList
EcDrawX11DrawPrimitive
EcDrawX11DrawSimpleAreaText
EcDrawX11DrawSimpleLineText
EcDrawX11DrawSimplePointText
EcDrawX11GetScreen
EcDrawX11SetColorSchemeExt
EcDrawX11SetScreen
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 339
EcEasyCreateSounding
EcManualUpdateAddAnnotation
EcManualUpdateAddMoveIndicator
EcManualUpdateAddObject
EcManualUpdateAddRemovalIndicator
EcManualUpdateFreeActionStructs
EcManualUpdateGetActionStruct
EcManualUpdateGetAllActionStructs
EcManualUpdateGetChartFeature
EcManualUpdateGetFeature
EcManualUpdateRefreshGhostCell
EcManualUpdateWithdrawUpdateAction
EcRiverChartGetNoticeMarkMode
EcRiverChartSetNoticeMarkMode
EcRouteGetVisibleLights
EcRouteStoreLightInfos
EcRuleGetAdmiraltyOverlay
EcRuleGetNoticeMarkMode
EcRuleGetSimpleIsolatedDangers
EcRuleGetSymbAllTimeLabels
EcRuleSetNoticeMarkMode
EcS63CheckCellPermitExpiryDate
EcS63CheckCellPermitExt
EcS63CheckCellPermitHWID
EcS63CheckCertificateExt
EcS63CreateCellPermit
EcS63DecryptCell
EcS63DecryptCellPermitExt
EcS63ReadCellPermits
EcS63ReadCellPermitsIntoPermitList
EcS63ReadENC
EcAISCreateTargetObject
EcAISDeleteTargetObject
EcAISFindTargetObject
EcAISGetTargetObjectData
EcAISSetTargetObjectData
EcAreaObjectCreate
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 340 20 Appendices
EcBSBCreateCatalogue
EcBSBUpdateCatalogue
EcChartSetHighlightInstruction
EcDeletedObjectGetClass
EcDENCCreateLocalPackage
EcDencLocalPackageAddCells
EcDencLocalPackageRemoveCells
EcDrawNTDrawChart
EcDrawNTDrawChartBoundary
EcDrawX11DrawChart
EcDrawX11DrawChartBoundary
EcEasyCreateDrawing
EcEasyCreateDrawing_S
EcEasyCreateObjectSharedPrimitive
EcEasyCreateSimpleArea
EcEasyCreateSimpleArea_S
EcEasyCreateSimpleCircle
EcEasyCreateSimpleCircle_S
EcEasyCreateSimpleFilledCircle
EcEasyCreateSimpleFilledCircle_S
EcEasyCreateSimpleLine
EcEasyCreateSimpleLine_S
EcEasyCreateSimplePoint
EcEasyCreateSimplePoint_S
EcEasyDeleteDrawing
EcGlobeAddPlace
EcGlobeAddPlaceExt
EcGlobeLoadData
EcGlobeLoadPlaceData
EcGlobeLoadPlaceDataExt
EcGlobeNTDrawRoutes
EcGlobeRemovePlace
EcGlobeRemovePlaceExt
EcGlobeX11DrawRoutes
EcMonitorCalculateOffTrack
EcMonitorCheckGuardZone
EcMonitorCheckGuardZoneManUpd
EcMonitorCreatePastTrack
EcMonitorCreatePastTrack_S
EcMonitorDefineGuardZone
EcMonitorDefineGuardZone_S
EcMonitorGetActiveWaypoint
EcMonitorGetActiveWaypoint_S
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 341
EcMonitorGetPastTrack
EcMonitorGetPastTrackByTime
EcMonitorMoveGuardZone
EcMonitorSetActiveWaypoint
EcMonitorSetPastTrack
EcMonitorSetPastTrackGap
EcMonitorSetPastTrackLength
EcObjectCreate
EcObjectCreate_S
EcQueryGetWarningText
EcQueryIsObjectDangerous
EcQueryPickFilter
EcQueryPickVisible
EcQueryReadDangerDictionary
EcQuerySpotAll
EcQuerySpotAll_S
EcRouteAddLegLine
EcRouteAddLegLine_S
EcRouteAddWaypoint
EcRouteAddWaypoint_S
EcRouteCheck
EcRouteCheckExt
EcRouteCheckManUpd
EcRouteClear
EcRouteDeleteLegLine
EcRouteDeleteWaypoint
EcRouteExport
EcRouteExportNamed
EcRouteGetCorridors
EcRouteGetPlannedWaypoints
EcRouteGetPlannedWaypoints_S
EcRouteImport
EcRouteInit
EcRouteInit_S
EcRouteInitNamed
EcRouteInitNamed_S
EcRouteIsSelected
EcRouteLegLineGetWaypoints
EcRouteLegLineSetType
EcRouteMoveWaypoint
EcRouteRelationsClear
EcRouteRelationsUpdate
EcRouteReleaseLegLine
EcRouteReverse
EcRouteSelect
EcRouteSetColor
EcRouteSetName
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 342 20 Appendices
EcRouteSpot
EcRouteSpot_S
EcRouteSpotNamed
EcRouteSpotNamed_S
EcRouteWaypointGetLegLines
EcRouteWaypointGetLegLines_S
EcRoutingCalculateOptimum
EcRoutingGetAllObjects
EcRoutingGetNearestLegs
EcRoutingGetNearestNodes
EcRoutingModifyLegs
EcRoutingModifyNodes
EcRoutingQueryLeg
EcS63DecryptUserPermit
EcTidesStationInitialize
In the table below the functions of ECDIS Kernel version 5.10 are shaded grey.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 343
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 344 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 345
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 346 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 347
);
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 348 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 349
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 350 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 351
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 352 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 353
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 354 20 Appendices
*name );
DLL_USE Bool EcRouteSetName( EcFeature route, const EcDictInfo
*dictInfo, const char *name );
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 355
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 356 20 Appendices
EcCurrentsInitialize
EcCurrentsFree
EcCurrentsPredict
EcCurrentsGetInfo
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 357
Description:
If the distinction is turned on fixed all-round lights with a nominal range less than
3 nautical miles will be symbolized by small coloured circles. If the distinction is
turned off, these lights will be symbolized in the same way as floating lights, i.e.
by a coloured teardrop symbol.
Note:
A call of this function invalidates all display lists of loaded cells and flushes the
cell cache. The change will take effect after the next call to
EcChartSymbolizeView() and EcDrawNTDrawCells()or
EcDrawX11DrawCells() respectively.
Remark:
If the switch is turned off symbolization complies with the Conditional
Symbology Procedure ‘LIGHTS03’ of the S-52 Presentation library.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 358 20 Appendices
Figures 20.1 and 20.2: Distinction on, ‘True’ (default, left) and
Distinction off ‘False’ (right)
Description:
If the value is set to True shallow areas will be covered by a faint lattice pattern.
By default this pattern is not displayed.
Note:
A call of this function invalidates all display lists of loaded cells and flushes the
cell cache. The change will take effect after the next call to
EcChartSymbolizeView() and EcDrawNTDrawCells() or
EcDrawX11DrawCells() respectively.
Remark:
According to Section 8.5.7 (Night-time shallow water indicator) of the S-52
Presentation Library it is recommended to use a lattice pattern for the night
display of shallow water.
Figures 20.3 and 20.4: Day bright / shallow pattern off, ‘False’ (default, left) and
Day bright / shallow pattern on, ‘True’ (right)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 359
Figures 20.5 and 20.6: Night display / shallow pattern off, ‘False’ (default, left) and
Night display / shallow pattern on, ‘True’ (right)
Description:
If the value is set to True quality information will be drawn on the chart. By
default quality information is not displayed.
Note:
A call of this function invalidates all display lists of loaded cells and flushes the
cell cache. The change will take effect after the next call to
EcChartSymbolizeView() and EcDrawNTDrawCells() or
EcDrawX11DrawCells() respectively.
Figures 20.7 and 20.8: No quality information, ‘False’ (default, left) and
Display of quality information (zone of confidence D), ‘True’ (right)
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 360 20 Appendices
Description:
If the value is set to True objects with additional information will show an
additional "inform" symbol. By default this symbol is not displayed.
Note:
A call of this function invalidates all display lists of loaded cells and flushes the
cell cache. The change will take effect after the next call to
EcChartSymbolizeView() and EcDrawNTDrawCells() or
EcDrawX11DrawCells() respectively.
Remark:
According to Section 8.6.1.1 of the S-52 Presentation Library a dedicated symbol
must be used to identify, on mariner’s command, objects carrying the INFORM
attribute.
Figures 20.9 and 20.10: Information symbol off, ‘False’ (default, left) and
Information symbol on, ‘True’ (right)
Description:
If the value is set to True a boundary is shown between official and unofficial
data. By default this boundary is not displayed.
Note:
A call of this function invalidates all display lists of loaded cells and flushes the
cell cache. The change will take effect after the next call to
EcChartSymbolizeView() and EcDrawNTDrawCells() or
EcDrawX11DrawCells() respectively.
Remarks:
According to Section 12.2.2 Conditional Symbology Procedure ’DATCVR02’,
2.1 Limit of ENC coverage, of the S-52 Presentation Library the limits of the
ENC coverage must be displayed by means of a ‘one-sided’ line with a diagonal
stroke on the non-HO data side.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 361
Figures 20.11 and 20.12: Show official boundary, ‘True’ (default, left) and
No display of official boundary, ‘False’ (right)
Description:
Sets the overall sizing factor for text. By default this factor is 1.0. Values less than
1.0 will downsize, values greater than 1.0 will enlarge the text. Only positive
values are allowed. To visualize the effect the chart must be redrawn. It is not
necessary to symbolize the cells again after having set the text size factor.
Remarks:
Section 7.1 of the S-52 Presentation Library deals with the Symbology Instruction
for Text Labels. According to 7.1.2.2 Parameters (CHARS) the minimum size of
an uppercase character is 3.51 mm (see figures 25.13 and 25.15 in chapter 20.2.7
below).
Description:
Enables/disables outlining of text in the chart image. By default outlining is
enabled. To visualize the effect the chart must be redrawn. It is not necessary to
symbolize the cells again after having changed the outline status.
Remarks:
The S-52 Presentation Library does not deal with text outlines. In many cases
outlining makes it easier to read the text, especially if a small text size has been
chosen (compare figures 25.13 and 25.15 below) .
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 362 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 363
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 364 20 Appendices
Note:
Up to Kernel version of December 2007 the OGC WMS Module is available
for Windows operating systems only. A version of OGC WMS Module
executable under Linux will be part of subsequent service releases.
Note:
The new OGC WMS Module is subject to constant development. So if you
want to utilize this module please contact SevenCs in advance to ensure that
you will be using the latest program version.
20.3.1.2 Communication
The WMS protocol uses HTTP as carrier protocol. The HTTP GET requests are
supplied with the information required to build a response result. The
implementation and technical details of building a HTTP server and / or client is
beyond the scope of the WMS module.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 365
Client functionality
URL Generator
Common client and server functionality
SRS/CRS to EC2007 datum and projections mapping
Memory deallocation
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 366 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 367
The parameter string must conform to RFC2396. Any extra processing and
character (de)escaping according to RFC2396 is assumed to be done outside the
WMS module.
Parameter names are case insensitive but parameter values are case sensitive, i.e.
REQUEST=GetMap is the same as request=GetMap but not as
REQUEST=getmap.
Memory is internally allocated for the resulting document and MIME type which
must be freed by the application using EcWMSFree() when no longer needed.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 368 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 369
context and ignore the WMS exception document returned by the URL
parser).
9. If the request is a GetCapabilities a capabilities XML document is
generated and the processing ends.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 370 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 371
remote server to find out which layers are available and which SRS/CRS are
supported. The desired SRS/CRS can then be used to prepare an EcView to be
able to draw a retrieved image from the remote server.
The EC2007 Kernel WMS module does not provide a facility for parsing XML
files. It is recommended that the application implementing a WMS client also uses
a suitable library to process the WMS XML responses.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 372 20 Appendices
20.3.11.1.1 Description
The WMS specification does not explicitly define any SRS/CRSs apart from those
in the AUTO and AUTO2 namespaces. The WMS specifications up to version 1.1.1
rely mainly on the EPSG database of projections and datum definitions. The
mapping files offer an application using the WMS module to define namespaces
and SRS/CRS codes at its own discretion. Samples are provided with mapping
files for the AUTO, AUTO2 and CRS namespaces as well as an excerpt from the
EPSG namespace.
Note that all SRS/CRSs defined in the found mapping files will be offered to the
client. The AUTO namespace additionally relies on providing an EPSG scaling
factor from which a subset is implemented in the WMS module:
9001 = metre
9002 = foot = 0,3048 meters
9003 = us foot = 0,304800609601219 meters
9014 = fathom = 1,8288 meters
9030 = nautical mile = 1852 meters
9035 = us mile = 1609,34721869444 meters
9036 = km = 1000 metres
9040 = british yard = 0,914398414616029 meters
9041 = british foot = 0,304799471538676 meters
9093 = statute mile = 1609,344 meters
9096 = international yard = 0,9144 meters
9101 = radian
9102 = degrees = 0,0174532925199433 radians (PI/180)
9103 = arc-minute = 1/60 degrees
9104 = arc-second = 1/60 arc-minutes
9105 = grad = 0,015707963267949 radians (PI/200)
9112 = centesimal minute = 1/100 grad
9113 = centesimal second = 1/100 centesimal minutes
It is also worth noticing that most publicly available WMS servers implement
WMS version 1.1.1 and support the EPSG:4326 SRS/CRS, but little more. The
EPSG:4326 SRS/CRS is basically a linear interpolation of latitude/longitude
without projection which is suitable for displaying e.g. satellite imagery.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 373
The public functions of the projection mapper are used internally by the WMS
module but can also be used separately. Note that the function
EcWMSDatumAndProjectionToCRS() allocates memory for the CRS string
which must be deallocated with EcWMSFree() when no longer needed.
20.3.11.2.1 Description
Memory allocated by the WMS module functions must be freed using the
EcWMSFree() function.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 374 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 375
2. Windows Systems
The use of other compilers is problematic under Windows operating systems, too.
With certain compilers of other manufacturers e.g. the implementation of function
calls may differ. That is why certain Kernel functions may not be usable.
EcNode functions
EcNodeCreate
EcPrimitiveGetNode
EcEdgeGetBoundingNode
EcNodeGetFirst
EcNodeGetNext
EcQueryNodeByRecId
EcQuerySounding
EcEdge functions
EcEdgeCreate
EcPrimitiveGetEdge
EcEdgeGetFirst
EcEdgeGetNext
EcQueryEdgeByRecId
EcPrimitive functions
EcRuleGetPrimitive
EcRuleMakeTempObject
EcPrimitiveCreate
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 376 20 Appendices
EcFeatureGetPrimitive
EcNodeGetPrimitive
EcEdgeGetPrimitive
EcPrimitiveGetFirst
EcPrimitiveGetNext
EcQueryPrimitiveByRecId
EcTopologyGetRelatedArea
EcFeature functions
EcEasyCreateDrawing
EcEasyCreateSimplePoint
EcEasyCreateSimpleLine
EcEasyCreateSimpleArea
EcEasyCreateSimpleCircle
EcEasyCreateSimpleFilledCircle
EcMonitorDefineGuardZone
EcMonitorCreatePastTrack
EcMonitorGetActiveWaypoint
EcRouteAddWaypoint
EcRouteAddLegLine
EcRouteWaypointGetLegLines
EcRouteGetPlannedWaypoints
EcRouteInit
EcRouteSpot
EcRuleGetFeature
EcFeatureCreate
EcPrimitiveGetFeature
EcFeatureGetFeature
EcObjectCreate
EcQuerySpotCell
EcQuerySpotAll
EcQueryPickCell
EcQueryPickAll
EcFeatureGetFirst
EcFeatureGetNext
EcQueryFeatureByRecId
EcQueryFeatureByObjectId
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 377
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 378 20 Appendices
20.7 Abbreviations
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 379
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 380 20 Appendices
20.8 Glossary
bearing is the direction of one terrestrial point from another, expressed as
angular distance from a reference direction, usually from 000° at
the reference direction, clockwise through 360°.
BSB is a file format used to describe and store raster image data and
textual documentation, representing both topographic maps and
nautical charts.
course is the horizontal direction in which a vessel is steered or intended to
be steered, expressed as angular distance from north, usually from
000° at north, clockwise through 360°. Strictly, the term applies to
direction through the water, not the direction intended to be made
good over ground.
course made good is the direction of the path actually followed at any given time.
depth contours are connecting points of equal depth on a chart. These lines present
a graphic indication of the configuration of the sea bottom.
dividers or pair of dividers, is an instrument originally used for dividing a
line into equal segments. The principle use of dividers in
navigation is to measure or transfer distances on a chart.
ECDIS is a navigation information system which displays selected
information from a system electronic navigational chart and
positional information from navigation sensors to assist the mariner
in route planning and route monitoring, and is required to display
additional navigation-related information.
ENC is the database issued for use with ECDIS on the authority of
government authorized hydrographic offices. It contains all chart
information necessary for safe navigation and may contain
supplementary information in addition to that contained in paper
charts (e.g. sailing directions) which may be considered necessary
for safe navigation.
great circle is the intersection of the surface of a sphere and a plane through the
center of the sphere. It is the largest circle that can be drawn on the
surface of the sphere, and is the shortest distance, along the surface,
between any two points on the sphere. The equator and the
meridians are great circles.
heading is the direction in which a vessel is pointed, expressed as angular
distance from north, usually from 000° at north, clockwise through
360°. Heading should not be confused with course. Heading is a
constantly changing value as the vessel oscillates or jaws back and
forth across the course due to the effects of sea, wind, and steering
error.
identification string also hardware ID string, is the string calculated for the Kernel
registration during the startup. The ID string is derived from the
hardware configuration and therefore system specific.
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 381
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 382 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 383
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 384 20 Appendices
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
20 Appendices Page 385
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010
Page 386 20 Appendices
include an acknowledgement:
"This product includes software written by Tim Hudson
(tjh@cryptsoft.com)"
The licence and distribution terms for any publically available version or
derivative of this code cannot be changed. i.e. this code cannot simply be
copied and put under another distribution licence
[including the GNU Public Licence.]
SevenCs Programming Guide: EC2007 ECDIS Kernel Vers. 5.12 May 2010