1 Feature: Json output for Reverse API
2 Testing correctness of json and jsonv2 output (API version v1).
4 Scenario Outline: Reverse json - Simple with no results
5 When sending v1/reverse with format json
8 Then a HTTP 200 is returned
9 And the result is valid json
10 And the result contains
13 When sending v1/reverse with format jsonv2
16 Then a HTTP 200 is returned
17 And the result is valid json
18 And the result contains
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
45 | has_address | attributes |
49 Scenario Outline: Reverse json - Simple OSM result
50 When sending v1/reverse with format <format>
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
58 | Data © OpenStreetMap contributors, ODbL 1.0. https?://osm.org/copyright |
59 And the result contains
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
67 | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
68 And the result has no attributes namedetails,extratags
75 Scenario: Reverse json - Extra attributes of jsonv2 result
76 When sending v1/reverse with format jsonv2
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 |
86 Scenario: Reverse json - Tiger address
87 When sending v1/reverse with format jsonv2
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 |
96 Scenario Outline: Reverse json - Interpolation address
97 When sending v1/reverse with format <format>
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 |
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
110 | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
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]] |
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
140 | 9.5039353 47.0657546, 9.5040437 47.0657781, 9.5040808 47.065787, 9.5054298 47.0661407 |
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
155 | M 9.5039353 -47.0657546 L 9.5040437 -47.0657781 9.5040808 -47.065787 9.5054298 -47.0661407 |
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
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> |