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 lines object (scheduled or not) on /stop_points #2223

Closed
sign0 opened this issue Oct 10, 2017 · 5 comments
Closed

Add lines object (scheduled or not) on /stop_points #2223

sign0 opened this issue Oct 10, 2017 · 5 comments

Comments

@sign0
Copy link
Contributor

sign0 commented Oct 10, 2017

Convenient to store for example the stop_points/stop_areas and their multiple relations (lines/routes) in offline.

Example (with #2222 PMR Pull request idea) :

http://api.navitia.io/v1/coverage/XXX/stop_points/?depth=3

{
	"codes": [...],
	"name": "XXX",
	"links": [...],
	"coord": {...},
	"label": "XXX",
	"equipments": [...],
	"administrative_regions": [...],
	"id": "XXX",
	"stop_area": {...},
	"lines": [
		"scheduled": true,
		"vehicle_journeys_statistics": {
			"nb_vehicle_journey_day_prm": 10,
			"nb_vehicle_journey_day_not_prm": 90,
			"nb_vehicle_journey_day_total": 100
		},
		"code": "XXX",
		"network": {...},
		"links": [...],
		"color": "000000",
		"routes": [...],
		"geojson": {...},
		"text_color": "FFFFFF",
		"physical_modes": [...],
		"codes": [...],
		"closing_time": "000000",
		"opening_time": "000000",
		"commercial_mode": {},
		"id": "XXX",
		"name": "XXX"
	]
}
@pbougue
Copy link
Contributor

pbougue commented Oct 10, 2017

This would probably be routes (maybe including lines), not lines directly.
And we have to see what fields are necessary, we don't want to output a too heavy feed.

@TeXitoi
Copy link
Contributor

TeXitoi commented Oct 10, 2017

That's not a viable solution. If we go this way, we should includes all the object that can be related to an object, and there is a lot (everything is connected!).

That would need something like GraphQL, and that's not for now.

@sign0
Copy link
Contributor Author

sign0 commented Oct 10, 2017

I know everything is connected :)

You can easily display the stops on a map, but without the network + physical_mode and the line_code/line_name, it's quite complicated to differentiate them (bus stop, subway stop, etc.), to show icons like CityMapper for example.

22403913_10213525770474236_1140364908_o

Option 1 : /coords/0.0;0.0/stop_points?distance=1000 + [forEach stops] /stop_points/<stop_id>/lines

  • Many queries for nothing.

Option 2 : /coords/0.0;0.0/lines?distance=1000

  • Lots of data for nothing (stops outside the bbox)

Option 3 : /coords/0.0;0.0/stop_points?distance=1000 + /coords/0.0;0.0/lines?distance=1000

  • Lots of data for nothing (stops outside the bbox) + matching lines with the stops.

Option 4 : Make an external cache

  • My current solution

... A simple sliding of the map restart all the requests ...

I really think the ideal would be a depth=4 with filters in the parameters to be able to hide fields.
Example : ?depth=4&filter=stop.lines.geojson,stop.lines.routes.geojson
So, everyone would be happy : depth=3 would not be overloaded, and depth=4 would be more complete for the differents use-cases.

@sign0
Copy link
Contributor Author

sign0 commented Oct 10, 2017

capture d ecran 2017-10-10 a 20 29 13

Hmmm : The physical_modes and commercial_modes fields in /stop_points are they recent ? 😆

@pbougue
Copy link
Contributor

pbougue commented Oct 11, 2017

I don't understand how it is linked to the previous conversation... If it is not we should open a separate issue.
Otherwise everyone will just loose any interest in the primary subject.

@sign0 sign0 closed this as completed Oct 21, 2017
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