Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GTFS bus feed #111

Merged
merged 46 commits into from
Jan 8, 2023
Merged

Use GTFS bus feed #111

merged 46 commits into from
Jan 8, 2023

Conversation

Katsute
Copy link
Member

@Katsute Katsute commented Jan 2, 2023

Prerequisites

Issues must meet the following criteria:

  • No similar pull request exists.
  • Code follows the general code style of this project.
  • No sensitive information is exposed.
  • Relevant comments have been added.

GitHub Copilot Disclaimer

The use of GitHub Copilot is strictly prohibited on this repository.

  • This pull does not use GitHub Copilot.

Changes Made

List any changes made and/or other relevant issues.

  • Add GTFS bus feed
  • Store token headers inside service provider
  • Optimize map usage
  • Remove redundant attribute classes
  • Remove redundant GTFS classes
  • Remove redundant reference classes
  • Optimize feed entity
  • Optimize alert feed entity
  • Remove json + unused regex count
  • Add missing variables
  • Rename similar methods

WF-3864033213

Bottom 🔽

Release Notes

🛑 This major update includes breaking changes 🛑

This update drops the SIRI bus API in favor of the GTFS bus API. This update is most likely not compatible with previous versions of the bus API; all other modes should still be compatible with this update.

  • Removed Json and JsonSyntaxException
  • Removed RailroadStop
  • Removed RailroadTripStop
  • Replaced merged GTFS types into transit types
  • Optimizations to request headers
  • Optimizations to token usage
  • Optimizations to vehicle feeds
  • Optimizations to vehicle requests
  • Optimizations to alert requests

Attributes

Inlined several attributes and removed respective interfaces:

  • Removed Bearing
  • Condensed RouteReference, StopReference, TripReference, and VehiclesReference into a single Reference class
  • Removed RouteDescription
  • Removed RouteShortName

Alerts

  • Added created time
  • Added updated time
  • Removed alert effect
  • Added alert type

Bus

Dropped SIRI API in favor of GTFS API.

Stop
  • Removed origin stop
  • Removed destination
  • Removed progress rate
  • Removed progress status
  • Removed aimed arrival time
  • Removed expected departure time
Vehicle
  • Added passenger count
  • Removed arrival proximity
  • Removed stop distance
Trip
  • Added stop sequence
  • Added delay

Subway

Vehicle
  • Added assigned indicator
  • Added rerouted indicator
  • Added skip stop indicator
  • Added turn train indicator
  • Added stop sequence

Long Island Railroad (LIRR)

Trip
  • Added trip stop sequence
  • Added trip stop schedule relationship

Metro North Railroad (MNR)

Vehicle
  • Added status

@Katsute Katsute added breaking change mta-bus Bus related issues and features labels Jan 2, 2023
@Katsute Katsute self-assigned this Jan 2, 2023
This was linked to issues Jan 2, 2023
@Katsute Katsute added this to the 2.0.0 milestone Jan 2, 2023
@Katsute
Copy link
Member Author

Katsute commented Jan 3, 2023

@Katsute Katsute added mta-subway Subway related issues and features mta-mnr Metro North Railroad related issues and features labels Jan 3, 2023
private final String stopCode = row.get(csv.getHeaderIndex("stop_code"));
private final String stopName = row.get(csv.getHeaderIndex("stop_name"));
private final String stopDesc = row.get(csv.getHeaderIndex("stop_desc"));

private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
private final String stopCode = row.get(csv.getHeaderIndex("stop_code"));
private final String stopName = row.get(csv.getHeaderIndex("stop_name"));
private final String stopDesc = row.get(csv.getHeaderIndex("stop_desc"));

private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));
private final Double stopLat = Double.valueOf(row.get(csv.getHeaderIndex("stop_lat")));
private final Double stopLon = Double.valueOf(row.get(csv.getHeaderIndex("stop_lon")));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@Katsute Katsute marked this pull request as ready for review January 7, 2023 02:27

private String status = requireNonNull(() -> vehicle.getCurrentStatus().name());
private Integer stopID = requireNonNull(() -> Integer.valueOf(vehicle.hasStopId() ? vehicle.getStopId() : tripUpdate.getStopTimeUpdate(0).getStopId()));

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
@Katsute

This comment has been minimized.

@ghost

This comment has been minimized.

@Katsute

This comment has been minimized.

@ghost

This comment has been minimized.

@Katsute

This comment has been minimized.

@ghost

This comment has been minimized.

@Katsute

This comment has been minimized.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Katsute I have approved this pull request

@Katsute Katsute merged commit 2a14b21 into main Jan 8, 2023
@Katsute Katsute deleted the gtfs-bus@c8dcb77 branch January 8, 2023 19:10
@ghost ghost locked and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change mta-bus Bus related issues and features mta-lirr Long Island Railroad related issues and features mta-mnr Metro North Railroad related issues and features mta-subway Subway related issues and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use GTFS bus feeds Use all bus data
1 participant