Nextbike: vehicle_types_available fill-in #39
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nextbike feeds are currently invalid, as the
station_status
does not provide the properyvehicle_types_available
.This PR fills them in, as bikes at stations in
free_bike_status.json
have their station's id assigned.The
GbfsNextbikeVehicleAvailabilityConverter
counts the number of vehicles per vehicle_type_id at each station and constructs the vehicle_types_available from this information.In cases not a single vehicle is assigned to a station, we add a single vehicle_types_id with count == 0 as vehicle_types_available.
Note that this is a workaround and might be a vehicle_type that will never be available at this station, or a vehicle_type which could be available sometimes will not appear in vehicle_types_available.