Code Monkey home page Code Monkey logo

Comments (3)

joeyfoo avatar joeyfoo commented on May 20, 2024 1

Just for clarity, there are two situations here:

  • Same bus number, same direction, calling twice at the same stop

    • 73, 315, 317 - all loop services (i.e. the service only has a single Direction 1)
    • In the Bus Arrival API, you only have a single object with "ServiceNo": "73", and the way to tell buses apart is to check each next bus's VisitNumber
    • "315": {
          "name": "S'Goon Int ⟲ Blk 538",
          "routes": [
              [
                  "66009",
                  // ...
                  "66121",
                  "66271", // <---
                  "66131",
                  // ...
                  "66139",
                  "66271", // <---
                  "66129",
                  // ...
                  "66009"
              ]
          ]
      }
  • Same bus number, different direction, calling once each at the same stop

    • 136 Direction 1 and 136 Direction 2
    • In the Bus Arrival API: you have two objects with "ServiceNo": "136", and the way to tell buses apart is to check each next bus's DestinationCode, tho they will be grouped together
    • "136": {
          "name": "Ang Mo Kio Int ⇄ Punggol Temp Int",
          "routes": [
              [
                  "54009",
                  // ...
                  "66121",
                  "66271", // <---
                  "66131",
                  // ...
                  "65009"
              ],
              [
                  "65009",
                  // ...
                  "66139",
                  "66271", // <---
                  "66129",
                  // ...
                  "54009"
              ]
          ]
      }

Since they are the same stop, it could be "combined" into a single dot

I don't think they should be combined, will be even more confusing. The only reason Serangoon Garden has this mess is because the bus stop is on a roundabout, and buses in both directions need to share the same bus shelter. Maybe just a solid line instead of a dashed line will do the trick.

from busrouter-sg.

nxdiiode avatar nxdiiode commented on May 20, 2024 1

I was having this issue too. These bus services have/had differentiation by their two-sided additional plate with the number - one way red plate & white number, the other way, the colours are reversed.

This could be used in the visualisation. Unfortunately, it seems to be required to be hard coded as 73 has white plate, then red plate. 123M red, then white. 123, 131 not loop but impacted. 136 stopped the practice altogether in 2016. The midway destination is shown on the LED front panel on first visit. I think that could be the best indication but not trivial to implement.

(Also, just ranting, these bus stops suffer from JSONs max. 3 buses structure as they practically show two of one direction, one of the other.)

from busrouter-sg.

cheeaun avatar cheeaun commented on May 20, 2024

Wow this is quite the discovery. You're right, this requires both arrivelah and busroutersg changes.

I've just checked the API response from LTA, there's no direction but there's OriginCode and DestinationCode, which I think they are the start and end bus stop codes.

Screenshot 2022-06-14 at 8 28 13 PM

As for bus 73, the only hint seems to be when both codes are the same:

Screenshot 2022-06-14 at 8 29 56 PM

Seems like VisitNumber would be important too, since it could hint which destination(?) the bus is going to 🤔

Your mockup looks good, but will need to extend this to the "summary" view here too:

Screenshot 2022-06-14 at 8 32 54 PM

Obviously the above is a bug, since it's only showing one 136. Maybe could still show one but two timings instead(?) Or maybe no need any changes as user can still open up the more detailed view 🤔

Looking at bus 73, seems like even the diagram can be "wrong" too, looking at this:

Screenshot 2022-06-14 at 8 38 47 PM

Since they are the same stop, it could be "combined" into a single dot 😅 For this, I think I'll set aside first for now 😛

Thanks for the report, I'll look into adding the fields on arrivelah first 🙏

from busrouter-sg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.