chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

routing: Move most of routing calculation functionalities to chaire-lib-backend #954

Open tahini opened 1 month ago

tahini commented 1 month ago

Currently, the routing calculation (both transit and other modes) is concentrated in the TransitRoutingCalculator file, in transition-common. That means from the frontend, each mode is a request to the backend and backend callers (batch routing, public API) pass through a fake socket event to call the modes.

Part of those calculations are not transition specific (only getting the geojson data for the transit routes require an actual PathCollection from Transition, but they could be gotten in another static way for other consumers). If they were in chaire-lib, Evolution could also make use of those functions.

Also, keeping the implementation details in the backend will make the frontend lighter.

The files that will need to be moved/refactored are TransitRoutingCalculator.ts, TransitRoutingResult.ts and RouteCalculatorResult.ts.