hafas-client icon indicating copy to clipboard operation
hafas-client copied to clipboard

HVV ferry departures not working.

Open fxb opened this issue 3 years ago • 6 comments

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.

fxb avatar Feb 23 '22 13:02 fxb

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 avatar Feb 23 '22 13:02 derhuerst

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

derhuerst avatar Feb 23 '22 13:02 derhuerst

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

fxb avatar Feb 23 '22 13:02 fxb

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

fxb avatar Feb 23 '22 13:02 fxb

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

fxb avatar Feb 23 '22 13:02 fxb

[...] 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.

derhuerst avatar Feb 23 '22 15:02 derhuerst