Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FeatureRequest: Support filtering by formFactor #215

Open
hbruch opened this issue Aug 23, 2023 · 4 comments · May be fixed by #226
Open

FeatureRequest: Support filtering by formFactor #215

hbruch opened this issue Aug 23, 2023 · 4 comments · May be fixed by #226
Labels
enhancement New feature or request

Comments

@hbruch
Copy link
Collaborator

hbruch commented Aug 23, 2023

We ingest feeds of various providers, which offer cars, bikes, cargo bikes, scooters etc.
We'd like to be able to group them by formFactor of the vehicle types they offer (accepting that some offer more than one).

I suggest to enhance the GraphQLQueryController.getOperators() by an optional formFactor filter. Providing specific formFactors only those operators are returned, which offer this kind of vehicles.

@testower testower added the enhancement New feature or request label Aug 23, 2023
@testower
Copy link
Collaborator

Doesn't sound like an unreasonable thing to support. The implementation is not trivial, since it requires aggregating data on the operator level, which we currently don't do elsewhere. Is this something you would like to contribute on?

@hbruch
Copy link
Collaborator Author

hbruch commented Aug 23, 2023

I'd give it a try. I see two options, a) aggregating (and probably storing) it at the operator's level or b) just implement a dynamic filter iterating over the operator's vehicle types, without returning the formFactors explicitly.
b) seems to be a simpler approach and IMHO sufficient for now. WDYT?

@testower
Copy link
Collaborator

The problem in both cases is that the "operator's vehicle types" is spread across all the operator's GBFS feeds - and right now we don't have a way to iterate over them, because we don't store any references to GBFS feeds per operator. It's not 100% clear how this feature should work. Should it consider only available vehicle types, or any vehicle type listed in vehicle_types.json. Should it update when vehicle_types.json changes? Should it be the union of all vehicle types in all vehicle_types.json files of that operator, also considering changes over time?

@hbruch hbruch linked a pull request Aug 25, 2023 that will close this issue
@hbruch
Copy link
Collaborator Author

hbruch commented Aug 25, 2023

Not sure if I am too optimistic, but please check the PR if I misinterpreted something. IMHO, the FeedProviderService allows iterating feeds and provides access to the operator(?).

I'd consider any vehicle type and as FeedProviderService accesses the most recent feed, it would always be up-to-date (respecting currently rented vehicle types, though they might not be available at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants