Heuristics based on the notion of a home country
Currently KTrip has no notion of a home country and does not distinguish between "national" or "international" trips. As a consequence if wish to plan a trip ending or starting at some random busstop in Utrecht, the Netherlands there is more than 50/50 chance I will be offered random places in rural France I never even suspected the existence of. This is unlikely to be a desirable feature for simple domestic travels (e.g. commute). The same applies to those unfortunate French people who cannot find their favourite rural busstop but keep getting offered such Dutch gems as "Viaduct, Utrecht".
However it is probably possible for KTrip to do better based on heuristics. This may also require some support in the public transport backend/frameworks but KTrip could pave the way for it by offering the ability to constrain trip planning to either:
- A home country/region
- The country/region in which you are currently located
- International trips
In the first instance this is mainly about sorting possible inputs: e.g. prefer Dutch busstops over French ones if my preferences/location indicate I am in the Netherlands.
Secondly, this information could also be used to constrain offers returned by public transport backend/framework code. E.g. when planning a domestic trip in the Netherlands the application should effectively ignore the many redundant and possibly mangled/reformatted results returned by "foreign" providers. For example when planning railway trips to Cuijk, the Netherlands there is a good chance KTtrip will display connections to "Cuijk Bhf". The "Bhf" is a German convention, indicating this data was (probably) returned by Deutsche Bahn, and it does not match with reality in the Netherlands: i.e. Cuijk station is simply referred to as "Cuijk" in Dutch.
Moreover when it comes to actual trip information such as delays and unplanned cancellations, foreign provides may well be worse than useless. There is significant additional latency in the data exchange between providers, meaning foreign providers do not stand a chance of having accurate up-to-date information on the timeliness and therefore feasibility of catching a particular connection. At least the foreign providers will always lag the domestic providers for that information, because the domestic provider is the first party and not the third party to that information.
Finally, building on a pattern, the heuristics can probably be further refined:
- Large countries like India might similarly have duplicate names for stations/stops within the country, and possibly even within a (sufficiently large) region/state/province
- It may be useful to have a bias towards "same class" of transport. E.g.:
- A user may have a city transport pass, or a railway pass but not both. Switching modes of transport to/from railway may not be preferable even if it winds up marginally shorter. In general it may be preferable to limit the number of transport types and associated complexity of transfers
- If the departure is at a railway station, and the destination could be interpreted as either a railway, tram, metro or bus stop it may be worth assuming "railway".
- On domestic travels it may be better to favour domestic services rather than international ones and in particular to disfavour options that require customs checks (e.g. Eurostar) unless deliberately set to travel/plan internationally.