c2corg / c2c_ui

User interface for https://www.camptocamp.org
https://www.camptocamp.org
GNU Affero General Public License v3.0
26 stars 32 forks source link

Feature: add transport information (and associated filters) to routes #3936

Open Nayor opened 2 months ago

Nayor commented 2 months ago

Community discussion about this feature (mandatory) Link to https://forum.camptocamp.org/t/projet-mw-ticket-131-amelioration-des-infos-transports-en-commun-tc/73092/47 where this feature has been validated

Expected behaviour When creating the route

This algorithm may be applied to already existing routes, but it may require human checks to ensure data quality

When viewing a route

When searching for an access waypoints

When updating an access waypoint

When searching for a route:

Alternatives considered

eddy-geek commented 2 months ago

When searching for a route:

Related discussion on the backend: https://github.com/c2corg/v6_api/issues/1067

eddy-geek commented 2 months ago

IMHO, this information has to be provided manually when creating the route, in order to certify that this route is accessible by public transportation.

Completely agree. Generally speaking the c2c data model is well thought-out and very flexible, BUT we need to surface it better in the UI:

It would be nice if any information about those access point was shown inline in the route page instead of requiring an extra click (which will very often lead to a poorly-filled access point details because these page are not much used currently).

(If people agree, this should probably be a separate issue)

Nayor commented 2 months ago

It would be nice if any information about those access point was shown inline in the route page instead of requiring an extra click

I Agree I'm thinking about a starting waypoint and ending waypoint document selector close to the waypoint selection, in order to them to specific lists (they will still be added to waypoints to avoid any breaking changes to the api or the data structure)

eddy-geek commented 2 months ago

I like the proposal overall, 2 comments:

Naming: start/end vs access: for most activities (all except paragliding and ski with lifts?) "end point" does not have a strong meaning separate from starting point. Many crossings (traverse, raid, expedition) don't have the 2 "directions" as distinct routes. And anyway for automatic estimation of existing routes it would be random which one is start/end I guess? so maybe the data model for storage of the results of "the algorithm" / manual tagging should be simply a list of 1 or 2 "access points" without naming them start/end ?

Caching: for public_transportation_rating of the route, I'm wondering whether storing it is mandatory? maybe a bit simpler algorithm (best accessibility value of all access points) could be implemented directly in search, if it doesn't slow it down too much? We also return them in the API like Florent suggested, and this way we avoid having to maintain things in sync when access points are edited? (I'm frankly not sure which solution is best)

Nayor commented 2 months ago

Naming: the end access is mainly for crossings (which of course can be done back and forth most of the time) It is needed because if there is no service at the end, the crossing cannot be done using public transportation, even if there is good service at the start An other idea:

public_transportation_rating storage I think the route's public_transportation_rating storage is mandatory in order to filter routes quickly:

Nayor commented 2 months ago

I've send a first pull request for the backend, without the starting and ending point part The starting and ending estimation allows to compute a public_transportation_information for 75% of all routes (2018 data) May be we can test this way to check if it fill the need ? And add the starting / ending point selection afterwards if it's relevant