Skip to content

henc · Chart File I/O

ENC / SENC / catalog / shape file load / save / unload

int hencLoad( const char *fn, bool flagLoadUpdate = true )
  • After loading the ENC cell file, convert it to SENC format.
  • Load the ENC catalog files and then load multiple ENC files.
  • Load the SENC files.
  • After loading the SENC catalog file, convert it to SENC format and load it into memory.
  • After loading the shape files, load multiple ENC files.

const char *fn : IN (Filename to load)

  • = 0 : Success
  • < 0 : Fail

int hencLoadENCintoDom( const char *fn, CDomNode *node )
  • Load ENC files into memory in CDomNode format.
  • Map information is not generated but only file contents are read.
  • Only the ENC file or Dom file that stores the ENC is available.
  • const char *fn : IN (filename to read)
  • CDomNode *node : IN, OUT (storage)
  • = 0 : Read Success

  • < 0 : Read Fail

int hencIsUpdateENC( CDomNode *node )

Check whether the map information is UpdateENC.

  • ENC information, It only works if it is a CDomNode read from a function.
  • == 0 : When it is judged as Update ENC
  • != 0 : When it is judged as not Update ENC

int hencGetEncVersion( CDomNode *node, int &major, int &minor )

Load the ENC file version of the map information loaded with . It is used when comparing ENC files or comparing patch versions.

  • ENC Information, It must be a CDomNode read from the function to work correctly.

= 0 : Success < 0 : Fail


int hencUpdateENCDom( CDomNode *nodeBase, CDomNode *nodeUpdate )

Patch the S-57 file with two ENC files loaded with the function.

  • CDomNode *nodeBase : IN (BASE ENC)
  • CDomNode *nodeUpdate : IN (UPDATE ENC)
  • = 0 : Success

  • < 0 : Fail

int hencLoadDom( CDomNode *node )
  • Read map information from data with CDomNode format.
  • It must be a CDomNode read from the to work correctly.

CDomNode *node : IN, OUT (storage)

  • = 0 : Read Success

  • < 0 : Read Fail

int hencSave( const char *fn )
  • All loaded map information is saved as CATALOG.SENC and SENC file for each map cell.
  • The individual map cell file is stored in the same directory path as the CATALOG file.

const char *fn : IN (CATALOG file name)

  • = 0 : Success
  • < 0 : Fail

int hencLoadFileListFromCatalogFile( const char *fn, list &filelist )

Get a list of files from an ENC or SENC Catalog file.

  • const char *fn : IN (catalog file name)
  • list &filelist : OUT (list of files)
  • = 0 : Success
  • < 0 : Fail

int hencSaveCatalogSENC( const char *fn )

Only the Catalog SENC file of the loaded map is saved, not the cell file.

const char *fn : IN (Name of catalog file to be saved)

  • = 0 : Success
  • < 0 : Fail

int hencEncfileSaveToSENC( int no, const char *dirSave )
  • Save the individual map cell file as a SENC file. At this time, the stored file name is used as the loaded file name.
  • Only the features set to ObjMask are saved.
  • See hencSetObjMask().
  • int no : IN
  • Number of map cell to store
  • When loading map cells, they are numbered sequentially from 0th.
  • By using functions such as and , you can know the already loaded file name and number.
  • const char *dirSave : IN (directory name to save)
  • = 0 : Success
  • < 0 : Fail

int hencEncfileToDom( int no, CDomNode &dom )

Copy the information of the individual map cell file. Only the features set to ObjMask are saved when saved. See hencSetObjMask(). You can use internal information through the class CDomNode.

  • Number of map cell to store
  • Map cells are numbered from 0 in the order they are loaded.
  • By using functions such as and , you can know the already loaded file name and number.

= 0 : Success < 0 : Fail


int hencEncfileSaveToMem( int no, LPVOID &ptr, int &size )

Store and copy the information of the individual map cell file into memory with SENC. Only the features set to ObjMask are saved when saved. See .

  • Number of map cell to store
  • Map cells are numbered from 0 in the order they are loaded.
  • By using functions such as and , you can know the already loaded file name and number.

= 0 : Success < 0 : Fail


int hencEncfileLoadFromMem( LPVOID ptr, int size )

Read SENC from memory.

LPVOID ptr : IN (SENC storage memory) int size : IN (size of SENC information)

= 0 : Success < 0 : Fail


int hencUnload( const char *fn )

Remove the map loaded with the filename from memory.

  • Must be the same as the file name given in the (int no).
  • At this time, the file name does not include a path.

= 0 : Success < 0 : Fail

int hencUnload( int idx )

Delete the map loaded with that number from memory.

int idx : IN (map number)

= 0 : Success < 0 : Fail


int hencUnloadAll()

Delete loaded all map information from memory.

None

= 0 : Success < 0 : Fail


int hencEncfileSetLimit( int cnt )

Limit the number of map cells loaded into memory. This can be used to create a demo version program.

int cnt : IN (maximum number of cells)

= 0 : Success < 0 : Fail


int hencEncfileGetCount()

Gets the number of map cells loaded into memory.

None

Number of map cells loaded


const char *hencEncfileGetName( int no )

Obtain the filename of the loaded map cell.

  • Map cells are numbered from 0 in the order they are loaded.

!= NULL : File name (Null-terminated string) == NULL : File name acquisition failed (file number not existing)


int hencEncfileGetInfo( int no, CDomNode &dom )

Acquires the file name and area information of the corresponding ENC.

int no : IN (ENC number to acquire information) CDomNode &dom : OUT (Save file name and area information)

= 0 : Success < 0 : Fail


bool hencIsENCFile( const char *fn )

Check that the input file is an S-57 ENC file.

const char *fn : IN (inspection filename)

true : If the ENC file is correct false : If it is an error or not ENC file


bool hencIsSENCFile( const char *fn )

Check that the input file is an hns SENC file.

const char *fn : IN (inspection filename)

true : If the SENC file is correct false : If it is an error or not SENC file


bool hencIsCatalogFile( const char *fn )

Check whether the file is a catalog file of ENC or SENC. And checks whether the file name is CATALOG.

const char *fn : IN (inspection filename)

true : Scan is successful (if the catalog file is correct) false : Check failed or error (if the catalog file does not match)


bool hencIsShapeFile( const char *fn )

Checks whether the file is a Shape file and confirms the extension of the file name.

const char *fn : IN (inspection filename)

true : Scan is successful. (if the shape file is correct) false : Check failed or error. (if the shape file does not match)


char *hencEncStringToMBC( const char *str )

It is used to decode a binary string used for storing ENC information loaded by and convert it into a multi-byte code.

const char *str : IN (Encoded string)

!= NULL : Converted string (Caller must free memory) == NULL : Conversion fail

The binary string that stores the ENC information has an encoding type and a binary string. It is a format for supporting the string encoding of the S-57 standard.