Giter VIP home page Giter VIP logo

sncf-smart-location's Introduction

SNCF Smart Location

Overview

SNCF Smart Location is a Bash command-line utility crafted to retrieve real-time positional and velocity data for trains in France. It's a resource tailored for travelers on trains who desire to garner detailed insights regarding their ongoing journey. This tool discerns the type of train based on the WiFi SSID (INTERCITES, INOUI, LYRIA, OUIFI) and employs train service APIs to procure the current latitude, longitude, and speed of the train.

Features

  • Retrieves and displays the real-time latitude and longitude coordinates and speed of the train.
  • Automatically identifies the train service type (Intercités de jour, Intercités de nuit, TGV-Inoui, Lyria, OuiGo) based on the WiFi SSID (INTERCITES, INOUI, LYRIA, OUIFI).
  • Utilizes the Overpass API to identify and exhibit nearby railway tracks and stations based on the current coordinates.
  • Offers a link to OpenRailwayMap for a visual representation of the train's location.
  • Assesses whether the train is nearing or departing from a specific station.

Requirements

  • jq for processing JSON responses.
  • curl for executing HTTP requests.
  • bc for performing mathematical operations.
  • A Unix-like operating environment for executing the Bash script.

Usage

  1. Clone the GitHub repository to your local device.
  2. Grant execute permission to the script: chmod +x sncf_smart_location.sh
  3. Execute the script: ./sncf_smart_location.sh Use -v or --verbose for detailed output and -q or --quiet to mute additional output.

Example

$ ./sncf_smart_location.sh
Current position (latitude longitude): 45.954069 5.341012
2 Railway Lines of Ligne de Mâcon à Ambérieu
Nearest station found: Ambérieu-en-Bugey Latitude Longitude 45.9538732 5.3418521
You are here: https://www.openrailwaymap.org/?lat=45.954069&lon=5.341012&zoom=14
The train is approaching Ambérieu-en-Bugey at 37 m and at 57 km/h

Limitations

  • Assumes that the user is aboard a train and connected to the train's WiFi network (_SNCF_WIFI_INOUI, _SNCF_WIFI_INTERCITES, OUIFI or _WIFI_LYRIA) for determining the train type.
  • The precision of the positional and speed data is contingent upon the train service APIs.

Contribution

Contributions to enhance SNCF Smart Location are welcomed. Generate a pull request to commence the contribution process.

License

The project is under the MIT License.

Disclaimer

SNCF Smart Location is an independent tool and is not officially associated with any train service providers. The precision and availability of data rely on the respective APIs utilized.

sncf-smart-location's People

Contributors

divulgacheur avatar filau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

filau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.