cheeaun / busrouter-sg

BusRouter SG: Singapore Bus Routes Explorer
https://busrouter.sg/
336 stars 103 forks source link

[feature request] Add NUS bus routes data #25

Closed davidchoo12 closed 3 years ago

davidchoo12 commented 6 years ago

Data can be retrieved from: http://nextbus.comfortdelgro.com.sg/testMethod.asmx/GetBusStops?output=json and http://nextbus.comfortdelgro.com.sg/testMethod.asmx/GetShuttleService?busstopname=COM2 Bus routes data can be retrieved from: http://www.nus.edu.sg/oca/Transport/Getting-around-NUS.html

I am a frequent user of your website, and I appreciate the work. It would be great if you can integrate the internal shuttle buses into your website as well. Thanks πŸ˜„

liaujianjie commented 5 years ago

I'm willing to work on this if pointed in the right direction. πŸ˜„

cheeaun commented 5 years ago

Hmm this looks like a 3-step work @liaujianjie

  1. Bus stops - can start by writing the scraper script, like tasks/fetchStopsLTA.js (or any tasks/fetchStops*** files), which by right should generate a file like data/3/stops.nus.json with almost the same data format. I think if these bus stops are not in the current list of stops, maybe will need to put in more info like bus stop names. The rest of the work I'll handle it :)
  2. Bus arrivals - will need to be done on https://github.com/cheeaun/arrivelah instead. Should be straightforward if can map all the values together.
  3. Bus routes - Looks like the link has moved to https://uci.nus.edu.sg/oca/transport-logistics-carpark/getting-around-nus/ πŸ€” - also I don't see any routes info with coordinates. This might be a little bit difficult...
davidchoo12 commented 5 years ago

Bus routes - Looks like the link has moved to https://uci.nus.edu.sg/oca/transport-logistics-carpark/getting-around-nus/ πŸ€” - also I don't see any routes info with coordinates. This might be a little bit difficult...

I created 2 maps for the nus bus routes. Google My Maps limit layers with driving routes so I had to split to 2. The maps use bus stop coordinates from http://nextbus.comfortdelgro.com.sg/testMethod.asmx/GetBusStops?output=json and the routes are made by manually linking the stops of each one using the "add driving route" feature. Note that the maps were made 10 months ago, so some of the routes might be outdated. https://drive.google.com/open?id=12_j-wc4SFZ6buYzA5BMopj9iK4H-dbkR&usp=sharing https://drive.google.com/open?id=111X4zI5LSVSB7eUwNEX3XR6M_NwAm-ZT&usp=sharing

Let me know how I can help πŸ˜ƒ

P.S. Hi fellow CS2103 student @liaujianjie

liaujianjie commented 5 years ago

@hidingmode Thanks, that's super helpful!

@cheeaun Since the routes data isn't provided as an API from elsewhere, should I just plonk the data from @hidingmode into data/3/routes/nus/...?

Edit:

Also, the data from the API above doesn't provide the road name. So my current implementation re-use the bus stop name for the road name:

{
    "LT13-OPP": {
        "BusStopCode": "LT13-OPP",
        "RoadName": "Ventus (Opp LT13)",
        "Description": "Ventus (Opp LT13)",
        "Latitude": 1.29530000686646,
        "Longitude": 103.770599365234
    }
}

Are we ok with this?

cheeaun commented 5 years ago

@liaujianjie data/3/routes/nus/... looks good to me πŸ‘

Seems fine to me also if you use the road name as the stop name, since it's better than no names at all πŸ˜„

RyanChng commented 5 years ago

Hey guys. I'm the 40th NUSSU EXCO Deputy Welfare Secretary for Internal Shuttle Bus matters. This seems like a very interesting project - do let me know if I can help in any way at depwelfare.ryan@nussu.org.sg!

By the way, you guys might want to check out the UCI website. They've updated the maps yesterday, replacing the previous graphic (which was just a list of stops) with an actual diagram overlaying the route and stops onto a street map.

liaujianjie commented 5 years ago

I've been pretty busy with school and work lately, gonna try wrap this up this week!

@RyanChng Hey, thanks for offering to help! I can't seem to find the map you mentioned about on the UCI website. Do you mind sharing the link to it? Also, it would be great if there's an official API for the bus routes, is there any?

RyanChng commented 5 years ago

Oh, the link I’m referring to is https://uci.nus.edu.sg/oca/transport-logistics-carpark/getting-around-nus/ (sorry posting from mobile); you’ll need to click β€œinternal shuttle bus” and then hit the links for the bus routes (uploaded as PDF maps). For API for bus route I’m still not sure. Might exist but on comfortdelgro's end.

davidchoo12 commented 5 years ago

Also, it would be great if there's an official API for the bus routes, is there any

@liaujianjie looking at http://nextbus.comfortdelgro.com.sg there seems to be an endpoint named GetActiveBus for routes, but it requires a token to access. Not sure if @RyanChng has access with the token?

RyanChng commented 5 years ago

Oh @hidingmode sorry I wouldn't have it, probably only an employee of CDG would!

tanhauhau commented 5 years ago

seemed like not much progress from here, can i work on this one?

cheeaun commented 3 years ago

Closing this (and the PR).

  1. The API seems like no longer there?
  2. The data collection work has been ejected to a separate repository πŸ‘‰ https://github.com/cheeaun/sgbusdata
  3. Anyone looking forward to work on this can start a new issue/discussion there.

Thanks πŸ™‡