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

Move routing calculation to chaire-lib-backend #982

Closed tahini closed 2 weeks ago

tahini commented 3 weeks ago

Add an review all data types regarding transit routing queries to chaire-lib-common.

Add a Routing.ts file which contains the main calculation function. This function takes a json object with the query parameters as argument and return results also as json objects, for easier serialization if necessary.

The TransitRoutingCaculator from transition-common is replaced by the Routing's chaire-lib-backend calculator and a RouitngUtils file in the transition-frontend to make the call to the routing socket route on the server.

In the frontend, the TransitRouting object is kept as it is easier to edit from the form by the user, but in the backend, it is all replaced with the parameter objects from chaire-lib-common.

A utility function can transform the result json objects to RoutingResult instances for easier manipulation by result handling functionalities.

tahini commented 3 weeks ago

There's already an issue to make it simpler: #983

At least this limits the number of callers to the inners of the calculation