Git Product home page Git Product logo

onemta's People

Contributors

dependabot[bot] avatar katsute avatar kdevbot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

onemta's Issues

Add method to refresh realtime data

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

Add a new method .update(inplace?) to stop, route, and vehicle objects; to allow developers to refresh realtime data without having to make new calls.

The inplace parameter should be false by default and return a new object to prevent developers from accidentally changing objects that are in use by other concurrent operations.

Reason

Prevent redundant calls to the base object and to reduce confusion for developers expecting the realtime data to update everytime they make a call.

Alert start/end periods are incorrect

Prerequisites

  • I have checked that no other similar issue already exists.
  • I have checked that this issue is actually a bug and not a feature.
  • I have checked discussions.
  • I have checked the documentation.

Operating System

Windows 10

Java Version

Java 17

Release Version

1.0.2

Issue

Same issue as #23, multiply this time number by 1000 to fix it.

private final Long start = requireNonNull(timeRange::getStart);
private final Long end = requireNonNull(timeRange::getEnd);

Code

No response

Arrival/departure time is incorrect

Prerequisites

  • I have checked that no other similar issue already exists.
  • I have checked that this issue is actually a bug and not a feature.
  • I have checked discussions.
  • I have checked the documentation.

Operating System

Windows 10

Java Version

Java 17

Release Version

1.0.1

Issue

Arrival/departure times are incorrect, code is expecting epoch to be in milliseconds while gtfs returns epoch in seconds. Fix this by multiplying the time by 1000.

private final Long arrival = requireNonNull(() -> stopTimeUpdate.getArrival().getTime());
private final Long departure = requireNonNull(() -> stopTimeUpdate.getDeparture().getTime());

private final Long arrival = requireNonNull(() -> stopTimeUpdate.getArrival().getTime());
private final Long departure = requireNonNull(() -> stopTimeUpdate.getDeparture().getTime());

private final Long arrival = requireNonNull(() -> stopTimeUpdate.getArrival().getTime());
private final Long departure = requireNonNull(() -> stopTimeUpdate.getDeparture().getTime());

Code

No response

Alert description is null

Prerequisites

  • I have checked that no other similar issue already exists.
  • I have checked that this issue is actually a bug and not a feature.
  • I have checked discussions.
  • I have checked the documentation.

Operating System

ubuntu-latest

Java Version

Java 17

Release Version

1.0.1

Issue

Possibly caused by the change in the service status proto: OneBusAway/onebusaway-gtfs-realtime-api@9d31123

private final String descriptionText = requireNonNull(() -> alert.getDescriptionText().getTranslation(0).getText());

private final String descriptionText = requireNonNull(() -> alert.getDescriptionText().getTranslation(0).getText());

private final String descriptionText = requireNonNull(() -> alert.getDescriptionText().getTranslation(0).getText());

private final String descriptionText = requireNonNull(() -> alert.getDescriptionText().getTranslation(0).getText());

Code

No response

Use all bus data

Feature

Anytime a bus is requested:

  1. Check the cache
  2. Pull data for all busses
  3. Parse
  4. Fulfill the request

Reason

Current implementation runs a new request for every bus which is not efficient for enterprise. Requesting all busses then parsing is more efficient when submitting multiple requests.

Failing to `resolveSubwayFeed` on express routes

Missing ~X routes

FeedMessage resolveSubwayFeed(final String route_id){
final String route = Objects.requireNonNull(MTASchema_Subway.resolveSubwayLine(route_id), "Subway route with ID '" + route_id + "' not found");
switch(route){
case "A":
case "C":
case "E":
case "FS":
case "SF":
case "SR":
return service.subway.getACE(subwayToken);
case "B":
case "D":
case "F":
case "M":
return service.subway.getBDFM(subwayToken);
case "G":
return service.subway.getG(subwayToken);
case "J":
case "Z":
return service.subway.getJZ(subwayToken);
case "N":
case "Q":
case "R":
case "W":
return service.subway.getNQRW(subwayToken);
case "L":
return service.subway.getL(subwayToken);
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "GS":
return service.subway.get1234567(subwayToken);
case "SI":
return service.subway.getSI(subwayToken);
default:
return null;

Update tests causing issues

Prerequisites

  • I have checked that no other similar issue already exists.
  • I have checked that this issue is actually a bug and not a feature.
  • I have checked discussions.
  • I have checked the documentation.

Operating System

ubuntu-latest

Java Version

Java 8, 11, 17

Release Version

1.1.0-SNAPSHOT

Issue

Using the update method causes some tests to fail, particularly vehicles. Change the update tests so it updates a new instance, rather than the one pregenerated for the test case.

Code

No response

Document enums

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

For methods that return enums as strings, use @see pointing towards the enum in the GTFS library.

Reason

Allow developers to easily see what string values can be returned.

Cancelled Trip API

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

The MTA SIRI Bus API has received an update: https://bustime.mta.info/wiki/Developers/CancelledTripAPIFeatures

Without Cancelled Trip Information With Cancelled Trip Information
v1 /api/siri/stop-monitoring.xml /api/2/siri/stop-monitoring.xml
v2 /api/siri/stop-monitoring.xml?version=2 /api/2/siri/stop-monitoring.xml?version=2

Stop-monitoring output

<MonitoredVehicleJourney>
  <MonitoredStopVisit>
--    <MonitoredCall>
--      <ArrivalStatus>cancelled</ArrivalStatus>
--      <DepartureStatus>cancelled</DepartureStatus>
--    </MonitoredCall>
++  <MonitoredVehicleJourney>
++      <VehicleStatus>cancelled</VehicleStatus>
++  </MonitoredVehicleJourney>
  </MonitoredStopVisit>
</MonitoredVehicleJourney>

Alert Support

 entity {
  id: "MTA NYCT_GH_A2-Weekday-SDon-063200_BX39_765"
  alert {
    informed_entity {
      agency_id: "MTA NYCT"
      trip {
        route_id: "BX39"
        direction_id: 0
      }
    }
    informed_entity {
      agency_id: "MTA NYCT"
      trip {
        route_id: "BX39"
        direction_id: 1
      }
    }
    effect: REDUCED_SERVICE
    description_text {
      translation {
        text: "The 10:32am BX39 to SOUNDVIEW AV/CORNELL AV is canceled"
        language: "EN"
      }
    }
  }
}

Reason

Required to keep up to date with API.

Add method to check if subway is express

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

Add method to subway vehicles to check if they are express.

Achieved by checking the route ID of the trip, express routes will end with an x.

Local example: 7
Express example: 7X

Reason

Subway express statuses are a commonly requested field

Add support for station transfer data

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

Add support for station transfer information. Keys are non-unique, csv parser may need to be altered.

Sample csv:

from_stop_id,to_stop_id,transfer_type,min_transfer_time
101,101,2,180
103,103,2,180
104,104,2,180
106,106,2,180
107,107,2,180

This method might need to be updated:

public final List<String> getRow(final String keyHeader, final String key){
final int index = getHeaderIndex(keyHeader);
if(index == -1) return null;
for(final List<String> row : rows)
if(row.get(index).equals(key))
return new ArrayList<>(row);
return null;
}

Reason

Developers may want transfer information.

Invalid LineRef for Bus Company

Prerequisites

  • I have checked that no other similar issue already exists.
  • I have checked that this issue is actually a bug and not a feature.
  • I have checked discussions.
  • I have checked the documentation.

Operating System

Windows 10

Java Version

Java 17

Release Version

1.1.0-SNAPSHOT

Issue

Busses under Bus Company use the LineRef: MTABC_ not MTA NYCT_

if(line != null) put("LineRef", "MTA%20NYCT_" + encodeUTF8(line));

private String routeID = requireNonNull(() -> monitoredVehicleJourney.getString("LineRef").substring(9));

The code needs to internally run a check if the Bus Company static data is used, and adjust the LineRef accordingly.

Code

No response

Utility methods

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

Provide utility methods for:

  • Checking if stops are exactly the same
  • Checking if bi-directional stops are the same main stop
  • Checking if express and non-express routes are the same route
  • Utility method for stop/route formatting for N/S/Express

Should be an interface class with:

  • .isExactStop() || .isExactRoute()
  • .isSameStop() || .isSameRoute()

Reason

Simplify equality checking.

(internal) zip changes for MTA bus static data

This issue ticket is for internal tracking, developers please refer to issue #61.


Bus data is served in a folder within the zip, rather than the base directory. The below section needs to be modified to reflect this change.

final ZipEntry entry = entries.nextElement();
final String name = entry.getName();
switch(name){
case "agency.txt":
case "routes.txt":
case "stops.txt":
case "transfers.txt":
try(final BufferedReader IN = new BufferedReader(new InputStreamReader(zip.getInputStream(entry)))){
data.put(entry.getName(), new CSV(IN.lines().collect(Collectors.joining("\n"))));
}catch(final IOException e){
throw new DataResourceException("Failed to read zip entry: " + entry.getName(), e);
}
}

zip files for MTA busses have changed

This issue has been resolved in #63. Please update your library to 1.2.1^.


Static data for MTA busses have recently changed so that data is saved inside a folder rather than the base directory in the zip file; because of this change the zip files are currently incompatible with this library.

image

In order to use the data with this library you must:

  1. Extract the zip file

    image

  2. Open the google transit folder

    image

  3. Select all the files

    image

  4. Right click and send to a compressed zip

    image

  5. Rename the zip file to the correct google transit zip

    image

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.