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

GBFS problem: incorrectly composed path #731

Closed
matteoferrux opened this issue Feb 10, 2025 · 9 comments · Fixed by #733 or #735
Closed

GBFS problem: incorrectly composed path #731

matteoferrux opened this issue Feb 10, 2025 · 9 comments · Fixed by #733 or #735

Comments

@matteoferrux
Copy link

matteoferrux commented Feb 10, 2025

I recently add the GBFS feed from the Lille metropolitan area. I notice that when a route is plotted, the first part of the route is well composed: starting from an address to the nearest bike station for my destination. But on arrival, on the last segment of the route, it asks me to drop the bike in the middle of nowhere, like a free-floating vehicle, when it should be returned to the station.

GBFS feed link: https://media.ilevia.fr/opendata/gbfs.json
Link to the development instance used: https://onboard-dev.mobilille.fr/
Example route : https://onboard-dev.mobilille.fr/api/v1/plan?time=2025-02-10T10%3A51%3A00.000Z&fromPlace=50.63151517666361%2C3.094756593937717%2C0&toPlace=50.6364924164736%2C3.0703012933901164%2C0&arriveBy=false&timetableView=true&pedestrianProfile=FOOT&preTransitModes=WALK,RENTAL,BIKE&postTransitModes=WALK,RENTAL,BIKE&directModes=WALK,RENTAL,BIKE&requireBikeTransport=true&transitModes=AIRPLANE,HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,COACH,REGIONAL_FAST_RAIL,REGIONAL_RAIL,METRO,SUBWAY,TRAM,BUS,FERRY,OTHER

@felixguendling
Copy link
Member

can you please add a screenshot?

@matteoferrux
Copy link
Author

Sure!

The example route with the API. Lille Flandres station (arrival point has several V'Lille stations nearby, but the route does not go there)

Image

The route in the opposite direction. You can see that it's advisable to take a bike, but on arrival I'm still asked to throw it in the middle of nowhere haha!

Image

If you ever need to identify where the stations are, you can find them here: https://mobilille.fr/se-deplacer/vlille

@felixguendling
Copy link
Member

@pablohoch can you have a look please?

@pablohoch
Copy link
Member

This problem occurs because when the GBFS feed doesn't include the optional return_constraint field (in vehicle_types.json), we currently assume that the vehicle can be returned anywhere, not just at stations. That assumption is wrong if the feed, like in this case, doesn't have free floating vehicles. Unfortunately, many feeds - even those with vehicles that can be picked up at stations and returned anywhere - don't include the optional return_constraint field and it is not clear to me from reading the GBFS specification what the default value should be.

Maybe the best way to fix it is to assume that vehicles picked up at a station can only be returned at stations (unless specified otherwise using return_constraint) and only vehicles listed in free_bike_status.json (even if currently parked at a station) can be returned anywhere. That should fix this issue and still support providers that allow returns anywhere, as long as all vehicles parked at stations are also listed in free_bike_status.json (not sure if that's required). I'll work on a PR to implement this.

@felixguendling
Copy link
Member

Perfect, thank you!

@matteoferrux
Copy link
Author

Despite your update, I notice that the problem persists on my test instance after the update. I've noticed the change in the station name as indicated in the pull request, but the problem with the end of the route is still there. Obviously, you've tested with the GBFS stream I provided above, and there's no apparent problem?

@pablohoch
Copy link
Member

Hmmm, you're right - it's now broken again. It was working before, but other providers caused problems, so I had to change the geofencing code. Maybe I forgot to test the Lille feed again after these changes. I'll look into it, sorry!

@pablohoch
Copy link
Member

I forgot a check if there are no geofencing zones defined. With #735 it should work correctly for the Lille feed (and feeds like Call-a-Bike also still work):

Image

I'm not super happy with the logic (as described in #733), but it's the best I could come up with given that so many fields and files are optional in GBFS and the defaults are often not specified. Hopefully this works for most feeds...

@matteoferrux
Copy link
Author

In my case, this correction works! Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants