Function TurnImport2_TXT(filename: string): integer;
This function loads turn restrictions from a text file on disk. Supply a full filename, including folder.
The format is one or more lines, where each line stores one restriction with parameters stored in space seperated format. Different types of restrictions are possible:
0: Simple Turn restriction, 2 external link IDs + 1 cost value
1: Simple Turn restriction, 2 link IDs + 1 cost value
2: TurnStandard, coordinates for node
3: Mandatory turn, 2 external link IDs
4: Mandatory turn, 2 link IDs
5: Complex Turn restriction, >2 external link IDs + 1 cost value
6: Complex Turn restriction, >2 link IDs + 1 cost value
File example:
// Comment
0 A4003234 A4003127 -1
1 456 230 -1
2 -77.024098 38.902711
3 A4003234 A4003127
4 456 230
5 A4003279 A4003234 A4003127 -1
6 89 456 230 -1
Lines starting with // are ignored as comments.
The free ITN converter will create turn restriction files in this format.
If you use turn restrictions with external ID's (type 0, 3 and 5), make sure you have called ExternIDOpen first or you will get an error code returned.
Type 0, 2, 3 and 4 gets translated into one or more type 1 during import and type 5 gets translated into type 6 during import.
Possible error codes: -10 -18 -32 -40 -43
Versions: Standard Pro
ActiveX / VCL / CLX component: RWnetBase