Managing Codes with Chouette
Chouette can manage different codes on models. A user can create codes manually or from macro lists. These codes can then be used for exports in the NeTEx export type.
Prerequisite : Code spaces
Before creating a code, the user must ensure that code spaces have been created at the Workgroup level:
To know more about Code Spaces, read the page Espaces de Code (translation to come).
Create a code manually
In Chouette, you can manually create a code for each model. To do this, enter the edit mode of the model, select a Code Space and enter the desired code.
For example, here we add a “Test” code to a company:
Create a code with a macro list
In Chouette, you can also create codes automatically using macro lists.
Here are the macro lists you can use to automatically generate codes in a desired format:
Jeux d'instructions | Créer un code à partir d’un UUID (translation to come)
Jeux d'instructions | Créer un code en séquence (translation to come)
For each of theses macro lists, you can find a detailed documentation in the User Manual.
Examples of code creation with a macro list
Here are a few examples of how macro lists can be used to create codes. Each macro list can be set up according to the targeted code model.
Use Case 1 : Create a code from the registration number
The user can use the “Create a code” macro list to create a new code, using the registration number of the Stop Area or Line.
The syntax “%{value}” is replaced by the value of the source attribute :
Use Case 2 : Prefix a Vehicle Journey code with a line registration number
The user can create a code on Vehicle Journeys by adding the number of the associated line. To do this, 2 syntaxes can be used:
%{line.code}
: is replaced by the registration number of the line%{line.code:<code_space>}
: is replaced by the line code on the target code space
These syntaxes can be used on all models linked to a line (vehicle journeys, timetables, routes).
Use Case 3 : Create a Timetable code using the line code and the UUID
A user can create a timetable code with a UUID and the associated line code. To do that, they can use the macro list “Create a code from the UUID”.
Export of the code spaces
Chouette can manage special code spaces withe the NeTEx export.
To learn more about the NeTEx export, read the page: Exports
In the export, select the code space that you want in the parameters:
Chouette includes in the export all the models that have a value in the selected code space. For other models, it uses the registration number or the "external" code, as per the usual procedure.