public-transport / hafas-client

JavaScript client for HAFAS public transport APIs.
ISC License
274 stars 53 forks source link

HVV ferry departures not working. #261

Closed fxb closed 1 year ago

fxb commented 2 years ago

It seems like HVV ferry departures are not working.

For example id 6256 is the Teufelsbrück stop.

Requesting departures via https://v5.hvv.transport.rest/stops/6256/departures?ferry=true always returns an empty array, while the HVV website lists ferry departures.

derhuerst commented 2 years ago

I'll check with hafas-client's debugging CLI:

cd hafas-client
./tools/debug-cli/cli.js hvv locations 'Teufelsbrück' | jq
[
    {
        "type": "stop",
        "id": "6256",
        "name": "Teufelsbrück",
        "location": {
            "type": "location",
            "id": "6256",
            "latitude": 53.54644,
            "longitude": 9.862866
        },
        "products": {
            "subway": false,
            "suburban": false,
            "akn": false,
            "regional-express-train": false,
            "regional-train": false,
            "ferry": true,
            "bus": false,
            "express-bus": false,
            "anruf-sammel-taxi": false,
            "long-distance-train": false,
            "long-distance-bus": false
        }
    },
    {
        "type": "stop",
        "id": "5822",
        "name": "Teufelsbrück (Fähre)",
        "location": {
            "type": "location",
            "id": "5822",
            "latitude": 53.547627,
            "longitude": 9.863845
        },
        "products": {
            "subway": false,
            "suburban": false,
            "akn": false,
            "regional-express-train": false,
            "regional-train": false,
            "ferry": false,
            "bus": true,
            "express-bus": false,
            "anruf-sammel-taxi": false,
            "long-distance-train": false,
            "long-distance-bus": false
        }
    },
    // …
]
./tools/debug-cli/cli.js hvv departures 6256 '{duration: 600}' | jq
# []
./tools/debug-cli/cli.js hvv departures 5822 '{duration: 600}' | jq
# []

TLDR: Yes, it seems like HVV's HAFAS mgate.exe API doesn't return ferries.

derhuerst commented 2 years ago

Can you check with other ferry lines and at another stop?

fxb commented 2 years ago

I did check some other stops as well, and none seemed to return anything.

fxb commented 2 years ago

Another example that basically only has ferrys stopping is 3598 ("Rüschpark")

fxb commented 2 years ago

I haven't read up on the internal workings of things yet, but could it have something to do with the bitmasks defined in https://github.com/public-transport/hafas-client/blob/master/p/hvv/products.js ?

I reported another issue that just from my gut feeling could also be caused by some mismatch of these bitmasks? See: https://github.com/public-transport/hafas-client/issues/262

derhuerst commented 2 years ago

[...] could it have something to do with the bitmasks [...] ?

Yes, this is how hafas-client requests departures for specific "products" (basically like categories).

But even without the bitmask in place, thus using the server's default, it doesn't return any departures for the stops 6256 & 5822.