path-data icon indicating copy to clipboard operation
path-data copied to clipboard

Incorrect mapping of "33rd Street" line to `JSQ_33_HOB` route

Open cedarbaum opened this issue 2 years ago • 1 comments

This API is returning the incorrect route for the "33rd Street" line. Below is an example response from the demo site where the line name is "33rd Street" but the route is JSQ_33_HOB. I've also included a screenshot from the official PATH website during the same time, which confirms the expected route is "33rd Street" without stopping at Hoboken.

I noticed this when using the downstream path-train-gtfs-realtime API. I am working on a patch to handle this case within that project for now. Please let me know if there's any further details I can provide, and thanks for your work on this project!

{
 "upcomingTrains": [
  {
   "lineName": "33rd Street",
   "headsign": "33rd Street",
   "route": "JSQ_33_HOB",
   "routeDisplayName": "Journal Square - 33rd Street (via Hoboken)",
   "direction": "TO_NY",
   "lineColors": [
    "#FF9900"
   ],
   "status": "ON_TIME",
   "projectedArrival": "2023-12-27T00:09:21Z",
   "lastUpdated": "2023-12-27T00:01:24Z"
  },
 ]
}

CleanShot 2023-12-26 at 19 03 50@2x

cedarbaum avatar Dec 27 '23 01:12 cedarbaum

I guess route name query SQL needs to be more specific. The SQL used for query route related info by headsignName and headsignColors is here: https://github.com/mrazza/path-data/blob/master/server/PathServices/PathSqlDbRepository.cs#L217 A quick run of the query of the DB download in an hour returns 2 matches, since we are using LIMIT 1 the first match will always be returned.

Capture

ghost avatar Feb 22 '24 18:02 ghost