conveyal / r5

Developed to power Conveyal's web-based interface for scenario planning and land-use/transport accessibility analysis, R5 is our routing engine for multimodal (transit/bike/walk/car) networks with a particular focus on public transit
https://conveyal.com/learn
MIT License
272 stars 71 forks source link

Add feed id column to path results #927

Closed ansoncfit closed 3 months ago

ansoncfit commented 5 months ago

This PR addresses #920, adding a column for feedIds to CSV path detail results. It also adds a "group" column to these results, reserved for future use. As noted in the discussion below and in #920, we are deriving the feedId from the boarding stop for convenience; this should generally correspond with the feedId of the route, but it may not (if, for example, a route has been subject to a reroute modification sending it to a stop from a different feed).

Because of some clumsy rebasing, the diff here looks larger than it is. See instead https://github.com/conveyal/r5/compare/dev...results-with-feedids

abyrd commented 5 months ago

As recently discussed: the number of fields will remain fixed. The feed ID field will always be present, but will be empty unless it is intentionally switched on. That is, it won't be automatically enabled even when there are multiple feeds in a bundle. It will be enabled using the "flags" approach demonstrated in #930.

I'm starting to wonder though whether this merits a structured CsvOptions in the request:

{
  csvOptions: {
    stopRepresentation: ID_AND_NAME,
    routeRepresentation: NAME_ONLY,
    includeFeedIds: true
  }
}

While we're already considering increasing the hard-wired number of columns, I'd like to suggest adding another empty-by-default field called "label" or "group", which would be used to facilitate filtering and grouping CSV output rows in specialized use cases (such as select-link).

abyrd commented 4 months ago

A few comments on the current implementation discussed during the call:

abyrd commented 3 months ago

Something strange is going on with the review process:

image

Even if I approve it Github says a review is required. When I do a git diff from this branch to dev locally, I see the expected set of changes which is different than the changes visible here.

abyrd commented 3 months ago

Superseded by #936 to overcome apparent bad state on the Github side.