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

Add physical_mode to departures and stop_schedules #1386

Closed
grote opened this issue Jan 22, 2016 · 4 comments
Closed

Add physical_mode to departures and stop_schedules #1386

grote opened this issue Jan 22, 2016 · 4 comments

Comments

@grote
Copy link

grote commented Jan 22, 2016

When querying for departures I need to know the physical mode of each departure to show it properly in my app.

Would it be possible to include a physical_mode object in the response to departures and stop_schedules queries?

Alternatively, I could of course make separate requests to get the physical mode for each
departure. But I guess it is also in your interest to not require users to make unnecessary excessive queries to your service.

@grote
Copy link
Author

grote commented May 20, 2016

Has this secretly been fixed?

A query like this http://api.navitia.io/v1/coverage/fr-idf/stop_areas/stop_area:OIF:SA:8775862/departures?from_datetime=20160519T223512&count=12&duration=86400&depth=0 now returns a list of departures that has a route and in this route seem always to be physical_modes like this:

                "physical_modes": [
                    {
                        "id": "physical_mode:Bus",
                        "name": "Bus"
                    }
                ]
                "physical_modes": [
                    {
                        "id": "physical_mode:RapidTransit",
                        "name": "Train de banlieue / RER"
                    }
                ]

Is this now reliable and stable for all /departures queries?

@pbougue
Copy link
Contributor

pbougue commented May 23, 2016

I'd say stable, but not fully reliable.

We added this to route objects, and this information is "most of the time" true. That is to say when a route only uses one physical_mode, it's true (as we only retrieve the first physical_mode linked to that route).
In the ideal model of the real world, this information linked to a route is a list, but in the real world it would be hard to find an instance where there are multiple physical_modes.

What you really want if I understand well is the departures/display_information/physical_mode to be an id and not a name (this information is reliable, as it is linked to the vehicle_journey). If so we will have a look to see if it's doable and how.

@grote
Copy link
Author

grote commented May 23, 2016

As long as every departure query gives me a route object that contains the physical mode of that departure I am happy and consider this issue resolved. I've never seen a line with two different physical modes in the wild.

The problem was that this information was sometimes there in the display information, but not reliable as it could not always be mapped to the officially supported physical modes.

@pbougue
Copy link
Contributor

pbougue commented May 24, 2016

If it's Ok for you, then I close this issue.

I did a little mistake, as we have a physical_mode list in route, so the information is reliable (but hard to read into if you have more than one mode).

We might look into enriching departures/display_information with a physical_mode id somehow, but not sure we will do, as this seems enough as it is.
Don't hesitate to reopen and we would probably look into that solution.

@pbougue pbougue closed this as completed May 24, 2016
grote added a commit to grote/public-transport-enabler that referenced this issue May 27, 2016
According to hove-io/navitia#1386, Navitia has finally added the
product to departure query results, so all information we need can now
be retrieved by one network query only.

The AbstractNavitiaProvider was adapted accordingly and all legacy code
including the Product Cache was removed.
schildbach pushed a commit to schildbach/public-transport-enabler that referenced this issue Jun 1, 2016
According to hove-io/navitia#1386, Navitia has finally added the
product to departure query results, so all information we need can now
be retrieved by one network query only.

The AbstractNavitiaProvider was adapted accordingly and all legacy code
including the Product Cache was removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants