Quickest Way to get Routes Associated with a Stop

99 views
Skip to first unread message

Jay Greenspan

unread,
Dec 22, 2022, 3:02:53 PM12/22/22
to MBTA Developers
Hi. I'm new to the dataset and am using the .txt files

Given a geospatial point, I'm trying to determine the nearest stops and the routes associated with those stops. For example, the nearest T stop to my location is Forest Hills, and it's an Orange Line stop.

Getting nearby stops is obviously  no problem, but getting from there to the Route I'm finding a little convoluted. The best I can tell, I have to use geo coordinates to find a Shape entry that includes coordinates very close to the stop I'm interested in. From there I need to look up the associated Trip and then match to the Route. 

I'm wondering if there's an easier way that I'm missing. 

Thanks. 

-j


Yuriy Yakimenko

unread,
Dec 22, 2022, 4:21:12 PM12/22/22
to massdotd...@googlegroups.com
Why not have a small database that matches stops to routes, and then when you have a number of nearest stops just look up which routes they belong to?

--
You received this message because you are subscribed to the Google Groups "MBTA Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to massdotdevelop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/massdotdevelopers/db3e2924-0057-49b7-977c-61792b207d52n%40googlegroups.com.

Jay Greenspan

unread,
Dec 22, 2022, 7:15:35 PM12/22/22
to MBTA Developers
On Thursday, December 22, 2022 at 4:21:12 PM UTC-5 Yuriy wrote:
Why not have a small database that matches stops to routes, and then when you have a number of nearest stops just look up which routes they belong to?

Sounds good to me. Best I can tell, to do that I'd have to follow the steps I outlined earlier. But again, I think it's likely I'm missing something. 

-j
Reply all
Reply to author
Forward
0 new messages