Skip to content

dnnskrgr/trias-php-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyTRIAS · PHP Proxy API for TRIAS (VDV)

Get real-time departure information via the TRIAS interface – quick and easy to read thanks to caching and various output formats.

What is TRIAS?

TRIAS is an XML-based, standardized exchange format for passenger information systems, developed by the Verband Deutscher Verkehrsunternehmen (VDV). It is used for structured communication between information systems, timetable services, and third-party applications. TRIAS is not yet in widespread use in Germany, but is currently being rolled out or piloted by many transport companies and data platforms.

More information & specifications: vdv.de/ip-kom-oev.aspx

Note

easyTRIAS is an unofficial project. You need access to a valid TRIAS endpoint (e.g., Connect Niedersachsen or MobiData BW). The access data must be entered in the configuration file.

Features

  • Live departure data: Querying live departure data via TRIAS using a stopPointRef for the stop.
  • Multiple formats: Output as json, xml, csv, html or raw (TRIAS-XML).
  • Caching: File-based caching to conserve API quotas.
  • Walking time filter: Filter for departures that are too early based on the walking time to the stop.
  • Icons & Colors: Mapping of transport types (e.g. bus, train, tram) to icons/colors is configurable.
  • Easy to deploy: Runs on PHP web servers from version 7.2 onwards with write permissions for the cache directory.

Input parameters

Parameter Type Required Default Description
stopPointRef string TRIAS stop ID (e.g. de:03241:31)
format string html Output format: json, xml, csv, html, raw
walkingMinutes integer 0 Walking time to the stop in minutes – earlier departures are filtered
forceRefresh 0/1 0 If set to 1, the cache will be bypassed and a fresh request is made

Cache duration and directory are configurable in /.env.ini; deactivation via duration 0.

Example calls

HTML table:

https://example.com/departures.php?stopPointRef=de:03241:31

JSON with walking time filter:

https://example.com/departures.php?stopPointRef=de:03241:31&format=json&walkingMinutes=5

Raw TRIAS XML for debugging:

https://example.com/departures.php?stopPointRef=de:03241:31&format=raw

Configuration

  • Main settings are defined in the /.env.ini file
  • Mappings are defined in the /src/Dictionaries.php file

License

This project is licensed under the Apache 2.0 License.

You may freely use, modify, and redistribute the code, even in commercial projects as long as the license and copyright notices are retained. Liability is excluded.

Author

Dennis Krüger · Hanover, Germany · https://www.denniskr.de

Contact / Feedback

Do you have ideas, feedback, or would like to collaborate?

Feel free to open an issue on GitHub or reach out directly via email: easytrias@denniskr.de

About

PHP Proxy API for public transport TRIAS interface

Topics

Resources

License

Stars

Watchers

Forks

Languages