forked from OpenRailwayMap/OpenRailwayMap-CartoCSS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yaml
251 lines (238 loc) · 8.71 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
openapi: 3.1.0
info:
description: API to search for OpenRailwayMap-vector
contact:
name: Hidde Wieringa
email: [email protected]
url: https://github.com/hiddewie/OpenRailwayMap-vector
license:
identifier: GPL-2.0-or-later
name: GNU General Public License v2.0 or later
title: OpenRailwayMap API
version: current
servers:
- url: https://openrailwaymap.fly.dev
tags:
- name: search
description: Search API
- name: status
description: Status API
externalDocs:
description: GitHub
url: https://github.com/hiddewie/OpenRailwayMap-vector#readme
paths:
/api/status:
get:
operationId: status
description: Status endpoint
summary: Status endpoint
tags:
- status
/api/facility:
get:
operationId: searchFacilities
summary: Facility search
description: |
The facility endpoint returns detail of a facility (station, junction, yard, …) by its name, UIC reference or reference.
The parameters q, name, ref and uic_ref are mutually exclusive.
It takes the first keyword of (name,uicref,ref) and the optional the operator to search for the data.
tags:
- search
parameters:
- name: q
in: query
schema:
type: string
example: Karlsruhe
description: |
search term (will be looked up in all `name=*` tags, `railway:ref=*` and `uic_ref=*`)
- name: name
in: query
schema:
type: string
example: Karlsruhe
description: |
search term (name search only)
- name: ref
in: query
schema:
type: string
example: Gd
description: |
search by official facility reference number/code only
- name: uic_ref
in: query
schema:
type: string
description: |
search by UIC reference number of a station (uses OSM tag `uic_ref=*`)
- name: limit
in: query
schema:
type: integer
default: 20
maximum: 200
description: maximum number of results
responses:
'200':
description: Success
content:
application/json:
schema:
type: array
items:
type: object
properties:
latitude:
type: number
longitude:
type: number
osm_id:
type: integer
description: |
OSM node ID
name:
type: string
nullable: true
railway:
type: string
nullable: true
railway_ref:
type: string
nullable: true
rank:
type: integer
description: |
an importance rank calculated by taking the public transport route relations into account using this station/halt
example:
- "osm_id": 4487545500
"name": "Gouda"
"railway": "station"
"railway_ref": "Gd"
"latitude": 4.7061636
"longitude": 52.01742449911598
"rank": 52
- "osm_id": 7606567286
"name": "Gouda Goverwelle"
"railway": "station"
"railway_ref": "Gdg"
"latitude": 4.7420993
"longitude": 52.01501279911619
"rank": 8
- "osm_id": 5370097609
"name": "Dubbele Wierickebrug - tussen Woerden en Gouda"
"railway": "site"
"railway_ref": null
"latitude": 4.809544
"longitude": 52.074374099111374
"rank": 0
- "osm_id": 5370103610
"name": "Hoge Gouwebrug - bij Gouda"
"railway": "site"
"railway_ref": null
"latitude": 4.6826321
"longitude": 52.017554399115966
"rank": 0
- "osm_id": 5370103611
"name": "Gouwebrug - bij Gouda"
"railway": "site"
"railway_ref": null
"latitude": 4.681521499999999
"longitude": 52.01886699911586
"rank": 0
'400':
description: |
Bad request: invalid parameter values
/api/milestone:
get:
operationId: searchMilestones
summary: Milestone search
description: |
The milestone endpoint returns the position of milestones or other items such as signals or level crossings with a mapped position on a line.
The API will return the features within a maximum distance of 10 km (hardcoded). The presence of an `operator=*` tag on the tracks is honoured, it will be used to
distinguish reference numbers used by different infrastructure operators and/or in different countries.
Mileage is read from the OSM tags `railway:position=*` and `railway:position:exact=*` with precedence of the exact mileage. The tracks must be tagged with a reference number (OSM tag `ref=*`).
The tracks must not tagged with `service=*` (this condition does not apply to tracks with `usage=industrial/military/test`).
Negative mileage is supported but gaps in mileage or duplicated positions (if railway lines are reroute) are not supported. For example, you cannot query for `16.8+200` or things like that.
tags:
- search
parameters:
- name: ref
required: true
in: query
schema:
type: string
example: '4201'
description: |
reference number of the railway route the mileage refers to (in this case, route means lines as infrastructure, not the services using the tracks)
- name: position
required: true
in: query
schema:
type: number
example: 18.4
description: |
position (can be negative)
- name: limit
in: query
schema:
type: integer
default: 20
maximum: 200
description: maximum number of results
responses:
'200':
description: Success
content:
application/json:
schema:
type: array
items:
type: object
properties:
latitude:
type: number
longitude:
type: number
osm_id:
type: integer
description: |
OSM node ID
ref:
type: string
description: |
Reference number of the railway line the feature is located on.
nullable: true
operator:
type: string
description: |
operator of the infrastructure
nullable: true
railway:
type: string
description: |
type of the facility following Tagging rules (https://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Operating_Sites), e.g. `milestone`, `level_crossing`, `signal`.
nullable: true
position:
type: number
description: |
Mileage of the feature
nullable: true
example:
- "osm_id": 3479484133
"railway": "milestone"
"position": 18.405
"latitude": 8.7064769
"longitude": 49.031523899684544
"ref": "4201"
"operator": null
- "osm_id": 3479484134
"railway": "milestone"
"position": 18.2
"latitude": 8.7045853
"longitude": 49.03277039968421
"ref": "4201"
"operator": null
'400':
description: |
Bad request: invalid parameter values