How to map route_id from LIRR/MNR json API feed to line name?

86 views
Skip to first unread message

Александр Кочкарёв

unread,
Sep 28, 2021, 9:06:10 AM9/28/21
to mtadeveloperresources
Hello!

For example, i get an alert like this:

       "alert": {
            "active_period": [
                {
                    "start": 1632506023,
                    "end": 1632507762
                }
            ],
            "informed_entity": [
                {
                    "agency_id": "LI",
                    "route_id": "5",
                    "transit_realtime.mercury_entity_selector": {
                        "sort_order": "LI:5:14"
                    }
                }
            ],
            "header_text": { ... },
            "description_text": { ... }
        }

And i want to match "route_id": "5" to some line name which i can see in https://new.mta.info page for Rails , like "Babylon", "City Zone", "Far Rockaway" etc.

Where can i get this mapping or route_id meaning information?

Patrick M

unread,
Sep 28, 2021, 10:02:35 AM9/28/21
to mtadeveloperresources
From the GTFS file (example here: https://openmobilitydata-data.s3-us-west-1.amazonaws.com/public/feeds/mta/86/20210927/original/routes.txt)

1 - Babylon
2 - Hempstead
3 - Oyster Bay
4 - Ronkonkoma
5 - Montauk
6 - Long Beach
7 - Far Rockaway
8 - West Hempstead
9 - Port Washington
10 - Port Jefferson
11 - Belmont
12 - City Zone

Александр Кочкарёв

unread,
Sep 29, 2021, 3:37:41 PM9/29/21
to mtadeveloperresources
Thank you so much! All is clear now.

Александр Кочкарёв

unread,
Oct 1, 2021, 12:54:42 PM10/1/21
to mtadeveloperresources
I've faced another trouble when try to match routes with lines.

I've got the latest gtfs.zip files for LIRR and MNR from https://openmobilitydata.org/

But there is some inconsistency with https://new.mta.info/ site.

1)  LIRR routes.txt has next record:

"11","","Belmont Park","2","60269E","FFFFFF"

But there no "Belmont Park" line at https://new.mta.info/ in Rail section.
Why? Is this line active?

2) MNR
On site i see next lines:
"Wassaic"
"Pascack Valley"
"Port Jervis" (i found in api feed that it matched to route_id "NJT:6")

but they are not listed in MNR routes.txt:
route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color
10,5,,MNR Shore Line East,,2,,555555,FFFFFF
11,2,,Haverstraw Ferry,,4,,009B3A,FFFFFF
12,3,,Hudson Rail Link(Spuyten Duyvil),,3,,009B3A,FFFFFF
13,3,,Hudson Rail Link(Riverdale),,3,,009B3A,FFFFFF
14,2,,Newburgh Ferry,,4,,009B3A,FFFFFF
3,1,,New Haven,,2,,EE0034,FFFFFF
4,1,,New Canaan,,2,,EE0034,FFFFFF
5,1,,Danbury,,2,,EE0034,FFFFFF
6,1,,Waterbury,,2,,EE0034,FFFFFF
1,1,,Hudson,,2,,009B3A,FFFFFF
2,1,,Harlem,,2,,0039A6,FFFFFF

What does it mean and how can i get route_id for this lines?

Will be glad to any advice.

2021-10-01_23-53-18.png


On Tuesday, September 28, 2021 at 9:02:35 PM UTC+7 Patrick M wrote:
Reply all
Reply to author
Forward
0 new messages