Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C chouette-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • chouette-core
  • Wiki
  • GTFS Export

GTFS Export · Changes

Page history
Updated GTFS Export (markdown) authored Jul 25, 2018 by emaffert's avatar emaffert
Hide whitespace changes
Inline Side-by-side
Showing with 30 additions and 34 deletions
+30 -34
  • GTFS-Export.md GTFS-Export.md +30 -34
  • No files found.
GTFS-Export.md
View page @ 7880b043
# Structure de l'export
# Export structure
L'export créée un zip contenant des fichiers csv.
Les fichiers csv produits par l'export gtfs sont :
L'The export creates a zip containing the following csv files:
- agencies.txt
- stops.txt
- routes.txt
......@@ -10,15 +8,15 @@ Les fichiers csv produits par l'export gtfs sont :
- stop_times.txt
- calendars.txt
Les fichiers respectent le format des fichiers GTFS défini dans la documentation officielle.
These files are compliant with the GTFS standard as defined in the official documentation.
Rappel de la documentation officielle google : https://developers.google.com/transit/gtfs/reference/
Google's official documentation: https://developers.google.com/transit/gtfs/reference/
# Traitement des fichiers
# Files processing
## agencies.txt
Une Agency GTFS sera créée à partir d'une Company Chouette.
A GTFS Agency is created from a Chouette Company.
| Chouette::Company | GTFS Agency |
| --- | --- |
......@@ -29,13 +27,13 @@ Une Agency GTFS sera créée à partir d'une Company Chouette.
| phone | agency_phone |
| email | agency_email |
Si l'attribut registration_number de la Company Chouette est vide, l'attribut GTFS agency_id sera égal à l'attribut id de la Company.
If the Chouette Company registration_number attribute is empty, the agency_id GTFS attribute will be the Company id attribute.
## stops.txt
Un Stop GTFS sera créé à partir d'un StopArea Chouette.
A GTFS Stop is created from a Chouette StopArea.
Lorsque l'on fait la liste des StopArea à exporter, on récupère toute la hiérarchie d'arrêt que l'on ordonne par .
When making the StopArea list to export, we fetch all the parents.
| Chouette::StopArea | GTFS Stop |
| --- | --- |
......@@ -47,15 +45,15 @@ Lorsque l'on fait la liste des StopArea à exporter, on récupère toute la hié
| url | stop_url |
| time_zone | stop_timezone |
Si l'attribut registration_number du StopArea Chouette est vide, l'attribut GTFS stop_id sera égal à l'attribut id du StopArea.
If the Chouette StopArea registration_number attribute is empty, the stop_id GTFS attributs will be the StopArea id attribute.
Si le StopArea Chouette a un parent, l'attribut GTFS parent_station sera rempli avec son identifiant GTFS.
If the Chouette StopArea has a parent, the parent_station GTFS attribute will be the parent GTFS identifier.
Si l'attribut Chouette area_type est égal à "zdlp" alors l'attribut GTFS location_type sera égal à "1", sinon il sera égal à "0".
If the Chouette StopArea area_type attribute is "zdlp", the location_type GTFS attributs will be "1", otherwise it will be "2".
## routes.txt
Une Route GTFS sera créée à partir d'une Line Chouette.
A GTFS Route is created from a Chouette Line.
| Chouette::Line | GTFS Route |
| --- | --- |
......@@ -66,44 +64,42 @@ Une Route GTFS sera créée à partir d'une Line Chouette.
| desc | route_desc |
| url | route_url |
Si l'attribut registration_number de la Line Chouette est vide, l'attribut GTFS route_id sera égal à l'attribut id de la Line.
If the Chouette Line registration_number attribute is empty, the route_id GTFS attributs will be the Line id attribute.
Si la Line Chouette a une Company, l'attribut GTFS agency_id sera rempli avec son identifiant GTFS.
If the Chouette Line has a Company, the agency_id GTFS attribute will be the Company GTFS identifier.
Si l'attribut Chouette transport_mode est égal à "rail" alors l'attribut GTFS route_type sera égal à "2", sinon il sera égal à "3".
If the Chouette Line transport_mode attribute is "rail", the route_type GTFS attribute will be "2", otherwise it will be "3".
## calendars.txt
Un Calendar GTFS sera créé à partir d'une TimeTable Chouette et de ses Periods et TimeTableDates.
A GTFS Calendar is created from a Chouette TimeTable and its Periods and TimeTableDates.
Pour chaque Chouette::VehicleJourney concerné par l'export, on effectue un traitement pour fusionner ses TimeTables, Periods, et TimeTableDates. Après ce traitement, nous obtenons une liste de périodes qui seront utilisées pour produire les Calendars GTFS. Ce traitement rend inutile l'utilisation de CalendarDate GTFS car les exceptions sont également fusionnées avec les périodes.
For each exported Chouette VehicleJourney, we merge all their TimeTables, Periods, and TimeTableDates. This merge give us a period list which we use to produce the GTFS Calendars. We don't need to use any GTFS CalendarDate as the exception days are merged in the periods.
Les Calendars sont générés à partir de ces périodes et ont un service_id aléatoire.
The GTFS Calendars are created with a newly generated service_id.
## trips.txt
Un Trip GTFS sera créée à partir d'un VehicleJourney Chouette, de son lien avec une ligne, et de ses périodes.
A GTFS Trip is created from a Chouette VehicleJourney, its Line, and Periods from its TimeTables.
On récupère la liste des périodes calculées à l'étape précédente, et pour chacune on créée un Trip GTFS.
For each Chouette VehicleJourney and each merged period from the last step, we create a GTFS Trip.
L'attribut GTFS route_id est l'identifiant GTFS de la Line associée au VehicleJourney.
The route_id GTFS attribute is the GTFS identifier from the VehicleJourney's Line.
L'attribut GTFS service_id est l'identifiant GTFS de la période.
The service_id GTFS attribute is the period GTFS identifier.
L'attribut GTFS trip_id est défini aléatoirement.
The GTFS Trips are created with a newly generated trip_id.
Si l'attribut wayback de la Route Chouette correspondant au VéhicleJourney est égal à "outbound" alors l'attribut GTFS route_type sera égal à "0", sinon il sera égal à "1".
If the Chouette VehicleJourney's Route wayback attribute "outbound", the direction_id GTFS attribute will be "0", otherwise it will be "1".
## stop_times.txt
Un StopTime GTFS sera créé à partir d'un VehicleJourneyAtStop Chouette.
Pour chaque période de chaque VehicleJourney calculée précédemment on créée un StopTime GTFS à partir de chaque VehicleJourneyAtStop du VehicleJourney.
A GTFS StopTime is created from a Chouette VehicleJourneyAtStop.
L'attribut GTFS trip_id est récupéré depuis l'étape précédente.
For each VehicleJourney's VehicleJourneyAtStop we create a GTFS StopTime for each Trip from the last step.
Les attributs GTFS arrival_time et departure_time sont respectivement calculés en fonction de arrival_time et arrival_day_offset et de departure_time et departure_day_offset pour reproduire le format des horaires GTFS (heure + 24 x offset).
The stop_id GTFS attribute is the GTFS identifier of the VehicleAtStop's StopArea.
L'attribut GTFS stop_id est l'identifiant GTFS du StopArea associé au VehicleAtStop Chouette.
The stop_sequence GTFS attribute is the order of the StopArea in the VehicleJourney's JourneyPattern.
L'attribut GTFS stop_sequence est égal à l'ordre du StopArea dans le JourneyPattern associé au VehicleJourney.
\ No newline at end of file
The arrival_time and departure_time GTFS attributes are respectively calculated with the Chouette attributes arrival_time and arrival_day_offset, and departure_time and departure_day_offset (time + 24 x day_offset).
Clone repository

Architecture

  • Data Models
  • Class Diagram

Install and configure

  • installation manual
  • Optional Feature flags
  • Policy management (TODO)

Best practices in code

Rails code rules

  • Writing a migration
  • Writing a model
  • Writing a controller
  • Writing a view
  • Writing a policy (TODO)
  • Writing a feature (TODO)
  • I18n

Test code rules

  • Writing a spec
  • Writing a javascript test

Exchange format

Neptune

  • Import TODO
  • Export TODO

GTFS

  • Import
  • Export

Netex

  • Import TODO
  • Export TODO