]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/v1_json.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / v1_json.feature
1 Feature: Json output for Reverse API
2     Testing correctness of json and jsonv2 output (API version v1).
3
4     Scenario Outline: Reverse json - Simple with no results
5         When sending v1/reverse with format json
6           | lat   | lon   |
7           | <lat> | <lon> |
8         Then a HTTP 200 is returned
9         And the result is valid json
10         And the result contains
11           | error |
12           | Unable to geocode |
13         When sending v1/reverse with format jsonv2
14           | lat   | lon   |
15           | <lat> | <lon> |
16         Then a HTTP 200 is returned
17         And the result is valid json
18         And the result contains
19           | error |
20           | Unable to geocode |
21
22         Examples:
23           | lat  | lon |
24           | 0.0  | 0.0 |
25           | 91.3 | 0.4    |
26           | -700 | 0.4    |
27           | 0.2  | 324.44 |
28           | 0.2  | -180.4 |
29
30     Scenario Outline: Reverse json - OSM result with and without addresses
31         When sending v1/reverse with format json
32           | lat    | lon   | addressdetails |
33           | 47.066 | 9.504 | <has_address>  |
34         Then a HTTP 200 is returned
35         And the result is valid json
36         And the result has <attributes> address
37         When sending v1/reverse with format jsonv2
38           | lat    | lon   | addressdetails |
39           | 47.066 | 9.504 | <has_address>  |
40         Then a HTTP 200 is returned
41         And the result is valid json
42         And the result has <attributes> address
43
44         Examples:
45           | has_address | attributes    |
46           | 1           | attributes    |
47           | 0           | no attributes |
48
49     Scenario Outline: Reverse json - Simple OSM result
50         When sending v1/reverse with format <format>
51           | lat    | lon   |
52           | 47.066 | 9.504 |
53         Then a HTTP 200 is returned
54         And the result is valid json
55         And the result has attributes place_id
56         And the result contains
57           | licence!fm |
58           | Data © OpenStreetMap contributors, ODbL 1.0. https?://osm.org/copyright |
59         And the result contains
60           | osm_type | osm_id     |
61           | node     | 6522627624 |
62         And the result contains
63           | lon       | lat        | boundingbox!in_box |
64           | 9.5036065 | 47.0660892 | 47.0660391, 47.0661393, 9.5035564, 9.5036566 |
65         And the result contains
66           | display_name |
67           | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
68         And the result has no attributes namedetails,extratags
69
70         Examples:
71           | format |
72           | json   |
73           | jsonv2 |
74
75     Scenario: Reverse json - Extra attributes of jsonv2 result
76         When sending v1/reverse with format jsonv2
77           | lat    | lon   |
78           | 47.066 | 9.504 |
79         Then a HTTP 200 is returned
80         And the result is valid json
81         And the result has attributes importance
82         And the result contains
83           | category | type   | name                  | place_rank | addresstype |
84           | shop     | bakery | Dorfbäckerei Herrmann | 30         | shop        |
85
86     Scenario: Reverse json - Tiger address
87         When sending v1/reverse with format jsonv2
88           | lat           | lon            |
89           | 32.4752389363 | -86.4810198619 |
90         Then a HTTP 200 is returned
91         And the result is valid json
92         And the result contains
93           | osm_type | osm_id    | category | type  | addresstype  |
94           | way      | 396009653 | place    | house | place        |
95
96     Scenario Outline: Reverse json - Interpolation address
97         When sending v1/reverse with format <format>
98           | lat       | lon        |
99           | 47.118533 | 9.57056562 |
100         Then a HTTP 200 is returned
101         And the result is valid json
102         And the result contains
103           | osm_type | osm_id |
104           | way      | 1      |
105         And the result contains
106           | lon       | lat        | boundingbox!in_box |
107           | 9.5705468 | 47.1185454 | 47.118494, 47.118596, 9.570495, 9.570597 |
108         And the result contains
109           | display_name |
110           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
111
112         Examples:
113           | format |
114           | json   |
115           | jsonv2 |
116
117     Scenario Outline: Reverse json - Output of geojson
118         When sending v1/reverse with format <format>
119           | lat      | lon     | polygon_geojson |
120           | 47.06597 | 9.50467 | 1               |
121         Then a HTTP 200 is returned
122         And the result is valid json
123         And the result contains
124           | geojson+type | geojson+coordinates |
125           | LineString   | [[9.5039353, 47.0657546], [9.5040437, 47.0657781], [9.5040808, 47.065787], [9.5054298, 47.0661407]] |
126
127        Examples:
128           | format |
129           | json   |
130           | jsonv2 |
131
132     Scenario Outline: Reverse json - Output of WKT
133         When sending v1/reverse with format <format>
134           | lat      | lon     | polygon_text |
135           | 47.06597 | 9.50467 | 1            |
136         Then a HTTP 200 is returned
137         And the result is valid json
138         And the result contains
139           | geotext!wkt |
140           | 9.5039353 47.0657546, 9.5040437 47.0657781, 9.5040808 47.065787, 9.5054298 47.0661407 |
141
142        Examples:
143           | format |
144           | json   |
145           | jsonv2 |
146
147     Scenario Outline: Reverse json - Output of SVG
148        When sending v1/reverse with format <format>
149           | lat      | lon     | polygon_svg |
150           | 47.06597 | 9.50467 | 1           |
151         Then a HTTP 200 is returned
152         And the result is valid json
153         And the result contains
154           | svg |
155           | M 9.5039353 -47.0657546 L 9.5040437 -47.0657781 9.5040808 -47.065787 9.5054298 -47.0661407 |
156
157        Examples:
158           | format |
159           | json   |
160           | jsonv2 |
161
162     Scenario Outline: Reverse json - Output of KML
163         When sending v1/reverse with format <format>
164           | lat      | lon     | polygon_kml |
165           | 47.06597 | 9.50467 | 1           |
166         Then a HTTP 200 is returned
167         And the result is valid json
168         And the result contains
169           | geokml!fm |
170           | <LineString><coordinates>9.5039\d*,47.0657\d* 9.5040\d*,47.0657\d* 9.5040\d*,47.065\d* 9.5054\d*,47.0661\d*</coordinates></LineString> |
171
172        Examples:
173           | format |
174           | json   |
175           | jsonv2 |