schildbach / public-transport-enabler

Unleash public transport data in your Java project.
https://groups.google.com/forum/#!forum/public-transport-enabler-discuss
GNU General Public License v3.0
378 stars 131 forks source link

Implement providers for Russian transport #56

Open KOLANICH opened 8 years ago

KOLANICH commented 8 years ago

https://tech.yandex.ru/rasp/ (in Russian, but everything is clear)

grote commented 8 years ago

There is some API documentation available here: https://tech.yandex.ru/rasp/doc/reference/schedule-point-point-docpage/ But knowing Russian to implement this is definitely helpful.

KOLANICH commented 8 years ago

Maps of Metro (not only Moscow one, but also ones of some Russian and Ukrainian cities). It seems that rest api is hiden carefully because the source of JS populating that element is obfuscated. https://github.com/ymaps/metro-jsapi/blob/70bbc2ed51f71924ab08c85ccacedef175fc9015/src/transportMap/Scheme.js#L32L33

KOLANICH commented 8 years ago

Also we can try tο use http://api.2gis.com/ as the source of info about bus stops and metro stations and mosgortrans.org as the source of bus schedules. 2gis has unpublic API (and a plans to make it public in future) for transport routes

https://catalog.api.2gis.ru/2.0/transport/route/get?id=<id of route> - is info about the route https://catalog.api.2gis.ru/2.0/transport/route/search?q=<search query>&region_id=<id of region>&key=<api key> - discovers routes

KOLANICH commented 8 years ago

Description of mosgortrans tool (can be used if you run out of queries in yandex)

http://www.mosgortrans.org/pass3/request.ajax.php?

1 list=ways&type=<type of transport> tram - tram trol - trolleybus avto - bus returns list of routes separated by \n

2 list=days&type=<type of transport>&way=<id of route> returns list of available schedules of the route You can decode schedule id, it is a bitmask of days (base 2), the first is Monday, the last is Sunday, for example 0000011 means weekend. 3 list=directions&type=<type of transport>&way=<id of route>&date=<schedule> returns directions names (endpoints sepaated by "-" and space characters), the first is AB, the second is BA 4 list=waypoints&type=<type of transport>&way=<id of route>&date=<days of week>&direction=<direction> returns names of stations 5 http://www.mosgortrans.org/pass3/shedule.php?type=<type of transport>&way=<id of route>&date=<days of week>&direction=<direction>&waypoint=<waypoints> waypoints can be all (this will give all the schedules) or a number of waypoint (this will give only one schedule) You have to parse HTML to get the schedules

KOLANICH commented 8 years ago

One more source for metro maps. https://github.com/Utyff/pMetro/blob/master/app/src/main/java/com/utyf/pmetro/settings/CatalogList.java