Imports
Description
Import allows saving a data set in the database, in the chosen format, to avoid the manual input of all the data. The validation tests are applied before the import to the database.
Consult the Imports
You can see the imports done by your organisation in “Workbench” - “Imports”.
For each import, Status, Name, Started at, Duration, Created by, are displayed.
You can filter the imports by:
Status
Name
Started at
Created by
Before a date
After a date
For each import, the star wheel of every import allows launching the accessible actions (see, download original file).
You can make an import of Neptune or GTFS file. Chouette recognise automatically the type of file.
The file data is stocked:
in the referential of lines and stops
in the data set created by the import
The data set is created with:
the import name
the list of referenced lines from file
the period covering from the first to the last day of calendars present in file
Start a manual import
To import the data into Chouette, you need to click on “New import”, fill in the template and choose a file to import.
Imported files must be encoded in UTF-8.
Chouette offers you the following options:
Choice of notification recipients
Automatic merge. You can request at import that the created data sets are merged automatically in case of success.
This automatic launch is not performed if the import fails (due to problems in reading data or errors in automatic validation).
Automatic archive. You can request at import to archive the created dataset if the import ends in failure. Thus the dataset will not block a new import of a corrected file that covers the same periods and lines.
Urgent data. You can request at import to flag your offer as urgent, so that it can be processed as a priority in the rest of the chain.
You can allow the import to make changes to Workbenches resources.
You can request at import to store the original XML resources.
You can request at import to deactivate all stops and lines that were previously imported and are no longer present in the current import file.
Warning, depending on the import data, this option can carry out a massive deactivation on the line and stop referential. To reactivate stops and lines back, they will have to be reimported into Chouette, or manually reactivated one by one.
You can ask the NeTEx import to synchronise models strictly with NeTEx resources (if a NeTEx attribute is not defined, the model attribute will be reset).
You can activate strict mode on import. Any attribute not defined in the imported file will be reset (even if the attribute is present in Chouette).
You can choose to which line supplier you want to allocate the lines in your import file.
You can choose to which stop supplier you want to allocate the stops in your import file.
You can choose a company that has to be used by default.
You can select a code space to be used when importing for code matching/creation.
The import type is automatic by default to manage files in GTFS or Neptune formats.
You can see the information of the import on its page.
The import can have the following status:
successful
warning
failed
pending
To be successful, import must contain the data able to pass through the validation.
During the import following tests are applied:
on format respect (syntactic and semantics)
on completeness and consistency of relations present in exchange format
optionally on the quality of data in sight of its exploitation
When the import is finished you receive a notification by email.
If the import is failed, on the import page you can see the files containing the errors that produced the failure.
In case of import failure caused by errors in the file, the Dataset created will contain only the correct data.
GTFS
“GTFS file” is a ZIP file containing the CSV files (a file by data type: stop areas, calendars, passing times etc). https://gtfs.org/documentation/schedule/reference/
At the GTFS import Chouette will treat in order the following CSV files:
agencies.txt
stops.txt
routes.txt
calendars.txt
calendar_dates.txt
trips.txt
stop_times.txt
Each CSV file must contain a certain number of attributes, that have to be completed according to the official format.
Here is an example of a typical GTFS file:
To do a GTFS import, use the default automatic import type.
NEPTUNE
Each NEPTUNE file represents the description of a line of transport network.
Generally a transport network, characterised by several transport lines, represents a collection of files .xml grouped in .ZIP.
Chouette processes the set of xml files located in the root of ZIP file chosen by the user, and validates them one by one.
To do a Neptune import, use the default automatic import type.
Shapes
To import a .ZIP file that groups the geometries of the shapes, you must define the import type as “Shape file”.
You can determine which column contains the shapefile identifier, in the ‘Attribute used as id’ field.
NeTEx Generic
To import an .xml file in generic NeTEx format with stops, lines, carriers, networks, etc., the type of import must be defined as “generic Netex”.
You can check the ‘Store original XML resources’ option for your NeTEx import. Chouette will then store the NeTEx XML resources for stops, stopping points, lines, companies, networks and line notices created or updated by this import.
Launch an API import
Chouette gives its users the option of importing their data via an API.
The description and use of this API (among others) is available in many languages via our Postman documentation.
To configure Postman requests, you need to retrieve the necessary login information from the Chouette interface.
organisation_code
can be found in the ‘Administrate > My organization’ section, under “Code”:
The API key has to be generated and retrieved in the “Settings > API keys” section.
To generate the key for your workspace, click on the ‘Add a new API key’ button.
The workbench identifier specified on this page corresponds to the workbench_id.
The workbench identifier will be your login, and the token as your password for Postman authorisation.
Postman allows you to use all the queries provided if you want to create your own workspace (see the ‘Run in Postman’ button in the top right-hand corner).
The import will be launched automatically on Chouette, with a corresponding import report. At the end of the import, a referential will be created in the same way as for a manual import.
Launch a command line import
enRoute also provides an opensource Chouette client. A description of how to use it is available on the bitbucket repository: https://bitbucket.org/enroute-mobi/chouette-client/src/master/
The source code includes two executables for Windows and Mac (see ‘Downloads’ in the menu).
Automatic purge of old imports
Chouette conserves the file of each import.
This conservation is limited in time (after a period of 90 days the imports are automatically deleted).