Download the PHP package irail/stations without Composer

On this page you can find all versions of the php package irail/stations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stations

All stations in Belgium

Build Status Dependency Status Software License

We try to maintain a list of all the stations in Belgium using CSV so everyone can help to maintain it on github. Furthermore, we have a PHP composer/packagist library for you to go from station name to ID and vice versa and we convert the CSV file to JSON-LD for maximum semantic interoperability.

Fields we collect

stations.csv

This file describes all NMBS/SNCB stations in Belgium. A station can have multiple platforms (stops), which are described in stops.csv.

stops.csv

This file describes all NMBS/SNCB stops in Belgium. Each platform is a separate stop location. All fields are computed using gtfs_data_extractor.php.

facilities.csv

This file describes facilities available in NMBS/SNCB stations. All fields are computed using web_facilities_extractor.php.

embarkment_statistics.csv

This file describes how many people embark a train at the given station per day. Statistics from october 2023, source: belgiantrain.be, Cijfers opgestapte reizigers

How we collect data

This repository contains two PHP scripts which can load all data from the NMBS GTFS public data and the NMBS website. These scripts can be used to generate all CSV files from scratch, and to update existing files.

Manual changes and corrections can be made to stations.csv. It is recommended to use the stations.csv file in this repository as a starting point instead of using the scripts to generate this file, as the repository versions includes manual fixes to station names and translations.

Any changes made to stops.csv or facilities.csv will be overwritten by the scripts. Therefore, any pull requests with the sole purpose of updating/modifying these files won't be accepted

Missing stations and missing fields in stations.csv are automatically added when the gtfs_data_extractor tool runs.

How to make a correction

Corrections to names, translations and locations can be made by adjusting fields in stations.csv:

If you want to make a correction to facilities.csv or stops.csv, don't fix the files, but fix the scripts instead, and let these scripts run to update the file for you.

In case you just want to reuse the data

Latest update over HTTP

JSON-LD is available at https://irail.be/stations/NMBS if you add the right accept header. For example, using curl on the command line, you would do this:

If you want to change this output, please change the CSV files over here first (we love pull requests)

In PHP project

Using composer (mind that we also require nodejs to be installed on your system in order to use the linked-data interface):

Then you can use the stations in your code as follows:

Don't forget to do a composer update from time to time to update the data

Building the RDF or JSON-LD

Using scripts, this data can be converted to JSON-LD. In order to run the script, run this command:

First time run this in your terminal (nodejs needs to be installed on your system):

Or install it globally using the npm package (you will need to run this again when there's an update to the stations file):

From then on, you can always run:

For extra commands, check:

We currently support the output formats TRiG, N-Quads and JSON-LD (default)

License

CC0: This dataset belongs to the public domain. You're free to reuse it without any restrictions whatsoever.

If you contribute to this repository, you agree that your contributions will be licensed under the CC0 open data license.

We do appreciate a link back to this repository, or a mention of the iRail project.


All versions of stations with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ml/json-ld Version ^1.0
cache/apcu-adapter Version ^1.0
cache/array-adapter Version ^1.0
cache/apc-adapter Version ^1.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package irail/stations contains the following files

Loading the files please wait ....