HierarchyCreate2
Previous  Top  Next

Function HierarchyCreate2(filename,fieldname: string; fieldindex: integer; netbclass: boolean): integer;

From the specified filename a file called hierarchy.bin is created, which holds all attributes regarding the links.

The file should be of type DBF (version 3) or DAT file (part of a TAB file).

In the case of a DAT file, the corresponding TAB file needs to be present.
If you supply fieldindex=0, the fieldname will be used. If you supply a fieldindex (1..) it will be used for reading from the file.
If the field, you are pointing at, is a floating point field, it will be rounded.

The values in the field should be in the range 1 to 5. Values outside of this range will be set to 5.

If netbclass=true, it is assumed you are reading from the TeleAtlas, netbclass field (range 0..6) and it will on the fly be recoded into the 1..5 range similar to the obsolete net1class field (range 0..4).

If you are using Navteq data, the field func_class can be used as it is.

Filename should include a fully qualified path.

Hierarchy.bin simply holds the values from the input file and so it is possible to write directly to this file if needed. It consists of 8-bit unsigned integers. You may even create the file from scratch yourself, if that suits you better, but you miss being able to encrypt the file.

Use OnAttributeCreateProgress event for tracking progress.

Examples:
HierarchyCreate2("network.dbf","func_class",0,false);

HierarchyCreate2("network.dbf","netbclass",0,true);

See also Hierarchical routing

Possible error codes: -10 -31 -40
ActiveX / VCL / CLX component: RWnetBase