Closed tahini closed 3 weeks ago
Without having looked at the code, I would name the TransitRoutingResult MultimodalRoutingResult. (Would a bike->carshare route be called Transit or something else ??)
Without having looked at the code, I would name the TransitRoutingResult MultimodalRoutingResult. (Would a bike->carshare route be called Transit or something else ??)
Currently, the class is really for transit result. When we really have Multi modal, we can revisit it and make it really generic for this kind of data.
Incidentally also fixes #286
This commit is part of work to move the routing calculations to chaire-lib instead of Transition, so that other tools can benefit from it (#954).
The main result interface is called
RoutingResult
. 2 classes implement itUnimodalRoutingResult
andTransitRoutingResult
. There is no need to call thegetWalkOnlyRoute
method anymore (it has been removed), as it is not part of the interface and required custom code. Rather, thegetPath
method will return either a Route or TrRoutingRoute in theTransitRoutingResult
class.Tests have been added for the results class.
TransitRoutingResult
required to be split between the common chaire-lib part (the class itself) and the transition part (requiring a PathCollection to get the geojson from transition paths). A parameter allows to specify how to retrieve the geojson from the route data.The result classes may still be improved later, as the route calculations are also moved to chaire-lib, to find more common grounds or add better types to route properties. This is mostly moving what currently exists, with minimal changes to existing code.