hove-io / navitia

The open source software to build cool stuff with locomotion
https://www.navitia.io/
GNU Affero General Public License v3.0
429 stars 127 forks source link

Update route error #2861

Open tcollard opened 5 years ago

tcollard commented 5 years ago

Hi, I try to update a route, so I keep stop_area id and route.id, and it works. But if I retry after few days, there is an 404 error. (unable to find object) I don't know if the stop_area id can change or I do a wrong request.

For instance, this request used to work few week ago. https://api.navitia.io/v1/coverage/2.131622;48.803564/stop_areas/stop_area:OIF:SA:2:239/routes/route:OIF:056356005:G/stop_schedules?from_datetime=20190708T185944&items_per_schedule=2&

If someone has any ideas, thx.

kinnou02 commented 5 years ago

Hi, id of objects can change if the data provider change the id in their database, there is currently no process in place to build stable id on navitia.io. also, data integration isn't handled by navitia itself.

from the id you are using it looks like your request is on fr-idf: all ids have been updated as we did change the source of data for this coverage since https://api.navitia.io/v1/coverage/fr-idf/ is used to provide the official "openservice" of Ile de France Mobilité This change allows us to provide disruptions and later realtime data.

clemishow commented 5 years ago

Is there any way to save a route? @kinnou02

pbougue commented 5 years ago

Unfortunately, I see no guaranteed way to save a PublicTransport object.

But those are highly dependent on data changes, it's only fallback that could help, but not always.

clemishow commented 3 years ago

Any news about this?

pbougue commented 3 years ago

Hello, AFAIK, there is no plan on guaranteeing ID stability from one dataset to the other. ID stability is a quite complicated problem, transitland tried to address that if I remember correctly, but not Navitia. There is a little word in doc on that (see Lifetime of id: https://doc.navitia.io/#objects-order)

So as for any Public-Transport object in Navitia, ID is not stable over datasets (although data producers are encouraged to make stable choices, like in GTFS specifications). If one really wants to offer stability of bookmarks, I would suggest keeping not only the ID but other information about the object (like name, position for stop) and then dig into autocompletion services or /places_nearby to try to recover if ID changes, but this would still not be a silver bullet. But to my knowledge there is no plan to offer stability on IDs when data changes in navitia, ever.