Improved www.ttss.krakow.pl
Jacek Kowalski
2017-04-13 d4eb9e7d6bc326a8efc069c25af2ee35ab87acc4
commit | author | age
c44370 1 ### SEARCH ###
JK 2 '/services/lookup/autocomplete/json' => [
3     'query' => function() { return TRUE; },
4 ],
5 [
6   {
7     "count":2,
8     "name":"Przystanki",
9     "type":"divider"
10   },
11   {
12     "id":"959",
13     "name":"Kraków Plaza",
14     "type":"stop"
15   },
16   {
17     "id":"3033",
18     "name":"Plaza",
19     "type":"stop"
20   }
21 ]
22 '/services/lookup/autocomplete/nearStops/json' => [
23 lat: position.coords.latitude,
24 lon: position.coords.longitude
25 ],
26 '/services/lookup/stopsByCharacter' => [
27     'character' => 'ctype_alnum', # eg. a
28 ],
29 {
30 "stops": [
31   {
32     "id": "6350927454370005192", # stop_full_id
33     "name": "AWF", # stop_name
34     "number": "113" # stop_id
35   },
36   {
37     "id": "6350927454370005262", # stop_full_id
38     "name": "Agencja Kraków Wschód", # stop_name
39     "number": "462" # stop_id
40   }
41 ]}
42 '/services/lookup/fulltext' => [
43     'search' => function() { return TRUE; }, # eg. Plaza
44 ],
45 {
46   "results":[
47     {
48       "stop":"959", # stop_id
49       "stopPassengerName":"Kraków Plaza" # stop_name
50     },
51     {
52       "stop":"3033", # stop_id
53       "stopPassengerName":"Plaza" # stop_name
54     }
55   ]
56 }
57
58 ### STOP INFOS ###
59 '/services/stopInfo/stop' => [
60     'stop' => 'ctype_digit', # stop_id (eg. 2741)
61 ],
62 {
63   "id": "6350927454370005343", # stop_full_id
64   "passengerName": "Św.Gertrudy" # stop_name
65 }
66
67 '/services/stopInfo/stopPoint' => [
68     'stopPoint' => 'ctype_digit', # stoppoint_id (eg. 274119)
69 ],
70 {
71   "id": "6350786716881923783", # stoppoint_full_id
72   "passengerName": "Św.Gertrudy (274119)", # stoppoint_name
73   "stopPointCode": "274119" # stoppoint_id
74 }
75
76 ### DEPARTURES ###
77     '/services/passageInfo/stopPassages/stop' => [
78         'stop' => 'ctype_digit',
79         'mode' => function($mode) { return in_array($mode, ['arrival', 'departure']); }, # (optional)
80         'startTime' => 'ctype_digit', # timestamp start time (eg. 1492035600000) (optional)
81         'timeFrame' => 'ctype_digit', # time period (eg. 30) (optional)
82     ],
83     '/services/passageInfo/stopPassages/stopPoint' => [
84         'stopPoint' => 'ctype_digit', # stoppoint_id (eg. 274119)
85         'mode' => function($mode) { return in_array($mode, ['arrival', 'departure']); }, # (optional)
86         'startTime' => 'ctype_digit', # timestamp start time (eg. 1492035600000) (optional)
87         'timeFrame' => 'ctype_digit', # time period (eg. 30) (optional)
88     ],
89     '/services/tripInfo/tripPassages' => [
90         'tripId' => 'ctype_digit',
91         'mode' => function($mode) { return in_array($mode, ['arrival', 'departure']); },
92         #'vehicleId' => 'ctype_digit',
93     ],
94
95 ### GEO INFORMATIONS ###
96 '/geoserviceDispatcher/services/stopinfo/stops' => [
97     'left' => 'ctype_digit', (eg. 72248395)
98     'bottom' => 'ctype_digit', (eg. 180282704)
99     'right' => 'ctype_digit', (eg. 72324457)
100     'top' => 'ctype_digit', (eg. 180349192)
101 ], # ALL: ?left=-648000000&bottom=-324000000&right=648000000&top=324000000
102 {"stops": [
103   {
104     "category": "tram", # stop_type
105     "id": "6350927454370005262", # stop_full_id
106     "latitude": 180315951, # stop_lat
107     "longitude": 72286426, # stop_lon
108     "name": "Agencja Kraków Wschód", # stop_name
109     "shortName": "462" # stop_id
110   },
111   {
112     "category": "tram", # stop_type
113     "id": "6350927454370005263", # stop_full_id
114     "latitude": 180322790, # stop_lat
115     "longitude": 72300966, # stop_lon
116     "name": "Walcownia", # stop_name
117     "shortName": "463" # stop_id
118   },
119   {
120     "category": "tram", # stop_type
121     "id": "6350927454370005260", # stop_full_id
122     "latitude": 180302996, # stop_lat
123     "longitude": 72258514, # stop_lon
124     "name": "Mrozowa", # stop_name
125     "shortName": "460" # stop_id
126   },
127   {
128     "category": "tram", # stop_type
129     "id": "6350927454370005261", # stop_full_id
130     "latitude": 180307241, # stop_lat
131     "longitude": 72267887, # stop_lon
132     "name": "Blokowa", # stop_name
133     "shortName": "461" # stop_id
134   }
135 ]}
136
137 '/geoserviceDispatcher/services/stopinfo/stopPoints' => [
138     'left' => 'ctype_digit', (eg. 72248395)
139     'bottom' => 'ctype_digit', (eg. 180282704)
140     'right' => 'ctype_digit', (eg. 72324457)
141     'top' => 'ctype_digit', (eg. 180349192)
142 ], # ALL: ?left=-648000000&bottom=-324000000&right=648000000&top=324000000
143 {"stopPoints": [
144   {
145     "category": "tram", # stoppoint_type
146     "id": "6350786716881695693", # stoppoint_full_id
147     "label": "",
148     "latitude": 180302630, # stoppoint_lat
149     "longitude": 72257903, # stoppoint_lon
150     "name": "Mrozowa (46029)", # stoppoint_name
151     "shortName": "460", # stop_id
152     "stopPoint": "46029" # stoppoint_id
153   },
154   {
155     "category": "tram", # stoppoint_type
156     "id": "6350786716881695683", # stoppoint_full_id
157     "label": "",
158     "latitude": 180303131, # stoppoint_lat
159     "longitude": 72259200, # stoppoint_lon
160     "name": "Mrozowa (46019)", # stoppoint_name
161     "shortName": "460", # stop_id
162     "stopPoint": "46019" # stoppoint_id
163   },
164   # ...
165 ]}
166
167 '/geoserviceDispatcher/services/pathinfo/route' => [
168     'id' => 'ctype_digit', # route_full_id (eg. 6350571212602605600)
169     'direction' => 'ctype_digit', # usually empty
170 ],
171 {"paths": [
172   {
173     "color": "#f89f05",
174     "wayPoints": [
175       {
176         "lat": 180189900,
177         "lon": 71689338,
178         "seq": "1"
179       },
180       {
181         "lat": 180189774,
182         "lon": 71689432,
183         "seq": "2"
184       },
185       # ...
186     ]
187   },
188   {
189     "color": "#f89f05",
190     "wayPoints": [
191       {
192         "lat": 180267296,
193         "lon": 71846885,
194         "seq": "1"
195       },
196       {
197         "lat": 180267358,
198         "lon": 71846773,
199         "seq": "2"
200       },
201       # ...
202     ]
203   }
204 ]}
205 '/geoserviceDispatcher/services/pathinfo/vehicle' => [
206     'id' => 'ctype_digit', # vehicle_id
207 ],
208 {"paths": [{
209   "color": "#f89f05",
210   "wayPoints": [
211     {
212       "lat": 180273283,
213       "lon": 71785307,
214       "seq": "1"
215     },
216     {
217       "lat": 180254905,
218       "lon": 71802223,
219       "seq": "2"
220     },
221     # ...
222   ]
223 }]}
224 '/geoserviceDispatcher/services/vehicleinfo/vehicles' => [
225     'lastUpdate' => 'ctype_digit', # timestamp changes since (optional)
226     'positionType' => function($type) { return in_array($type, ['CORRECTED', 'NORMAL']); },
227     'colorType' => function($type) { return in_array($type, ['ROUTE_BASED']); },
228 ],
229 {
230   "lastUpdate":1492038023040, # timestamp last changed
231   "vehicles": [
232     {
233       "id":"6352185295672181174", # vehicle_id
234       "isDeleted":true
235     },
236     {
237       "id":"6352185295672180864", # vehicle_id
238       "category":"tram",
239       "color":"0xf89f05",
240       "tripId":"6351558574046733842", # trip_id
241       "name":"10 Zajezdnia Nowa Huta", # route_id + ' ' + route_direction
242       "path":[
243         {
244           "length":1.991105220739696E-4,
245           "y1":180243882,
246           "y2":180243806,
247           "x2":72231876,
248           "angle":260,
249           "x1":72232589
250         },
251         {
252           "length":1.0915844844071638E-4,
253           "y1":180243806,
254           "y2":180243766,
255           "x2":72231485,
256           "angle":260,
257           "x1":72231876
258         }
259       ],
260       "longitude":72229100,
261       "latitude":180308704,
262       "heading":0
263     }
264   ]
265 }
266
267 ### ROUTES ###
268 '/services/routeInfo/route' => [],
269 {"routes": [
270   {
271     "alerts": [],
272     "authority": "MPK", # route_authority
273     "directions": [
274       "Salwator", # route_direction
275       "Wzgórza Krzesławickie" # route_direction
276     ],
277     "id": "6350571212602605599", # route_full_id
278     "name": "1", # route_id
279     "shortName": "1" # route_id
280   },
281   {
282     "alerts": [],
283     "authority": "MPK", # route_authority
284     "directions": [
285       "Cmentarz Rakowicki", # route_direction
286       "Salwator" # route_direction
287     ],
288     "id": "6350571212602605600", # route_full_id
289     "name": "2", # route_id
290     "shortName": "2" # route_id
291   },
292   # ...
293 ]}
294
295 '/services/routeInfo/routeStops' => [
296     'routeId' => 'ctype_digit',
297 ],
298 {
299   "route": {
300     "alerts": [],
301     "authority": "MPK", # route_authority
302     "directions": [
303       "Salwator", # route_direction
304       "Wzgórza Krzesławickie" # route_direction
305     ],
306     "id": "6350571212602605599", # route_full_id
307     "name": "1", # route_id
308     "shortName": "1" # route_id
309   },
310   "stops": [
311     {
312       "id": "6350927454370005262", # stop_full_id
313       "name": "Agencja Kraków Wschód", # stop_name
314       "number": "462" # stop_id
315     },
316     {
317       "id": "6350927454370005261", # stop_full_id
318       "name": "Blokowa", # stop_name
319       "number": "461" # stop_id
320     },
321     # ...
322   ]
323 }