]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/v1_geocodejson.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / v1_geocodejson.feature
1 Feature: Geocodejson for Reverse API
2     Testing correctness of geocodejson output (API version v1).
3
4     Scenario Outline: Reverse geocodejson - Simple with no results
5         When sending v1/reverse with format geocodejson
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
14         Examples:
15           | lat  | lon |
16           | 0.0  | 0.0 |
17           | 91.3 | 0.4    |
18           | -700 | 0.4    |
19           | 0.2  | 324.44 |
20           | 0.2  | -180.4 |
21
22     Scenario Outline: Reverse geocodejson - Simple OSM result
23         When sending v1/reverse with format geocodejson
24           | lat    | lon   | addressdetails |
25           | 47.066 | 9.504 | <has_address>  |
26         Then a HTTP 200 is returned
27         And the result is valid geocodejson with 1 result
28         And the result metadata contains
29           | version | licence | attribution!fm |
30           | 0.1.0   | ODbL    | Data © OpenStreetMap contributors, ODbL 1.0. https?://osm.org/copyright |
31         And all results have <attributes> country,postcode,county,city,district,street,housenumber,admin
32         And all results contain
33           | param               | value |
34           | osm_type            | node |
35           | osm_id              | 6522627624 |
36           | osm_key             | shop |
37           | osm_value           | bakery |
38           | type                | house |
39           | name                | Dorfbäckerei Herrmann |
40           | label               | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
41           | geojson+type        | Point |
42           | geojson+coordinates | [9.5036065, 47.0660892] |
43
44         Examples:
45           | has_address | attributes     |
46           | 1           | attributes     |
47           | 0           | no attributes |
48
49     Scenario: Reverse geocodejson - City housenumber-level address with street
50         When sending v1/reverse with format geocodejson
51           | lat        | lon        |
52           | 47.1068011 | 9.52810091 |
53         Then a HTTP 200 is returned
54         And the result is valid geocodejson with 1 result
55         And all results contain
56           | housenumber | street    | postcode | city    | country |
57           | 8           | Im Winkel | 9495     | Triesen | Liechtenstein |
58          And all results contain
59           | admin+level6 | admin+level8 |
60           | Oberland     | Triesen      |
61
62     Scenario: Reverse geocodejson - Town street-level address with street
63         When sending v1/reverse with format geocodejson
64           | lat    | lon   | zoom |
65           | 47.066 | 9.504 | 16 |
66         Then a HTTP 200 is returned
67         And the result is valid geocodejson with 1 result
68         And all results contain
69           | name    | city    | postcode | country |
70           | Gnetsch | Balzers | 9496     | Liechtenstein |
71
72     Scenario: Reverse geocodejson - Poi street-level address with footway
73         When sending v1/reverse with format geocodejson
74           | lat      | lon     |
75           | 47.06515 | 9.50083 |
76         Then a HTTP 200 is returned
77         And the result is valid geocodejson with 1 result
78         And all results contain
79           | street  | city    | postcode | country |
80           | Burgweg | Balzers | 9496     | Liechtenstein |
81
82     Scenario: Reverse geocodejson - City address with suburb
83         When sending v1/reverse with format geocodejson
84           | lat       | lon      |
85           | 47.146861 | 9.511771 |
86         Then a HTTP 200 is returned
87         And the result is valid geocodejson with 1 result
88         And all results contain
89           | housenumber | street   | district | city  | postcode | country |
90           | 5           | Lochgass | Ebenholz | Vaduz | 9490     | Liechtenstein |
91
92     Scenario: Reverse geocodejson - Tiger address
93         When sending v1/reverse with format geocodejson
94           | lat           | lon            |
95           | 32.4752389363 | -86.4810198619 |
96         Then a HTTP 200 is returned
97         And the result is valid geocodejson with 1 result
98         And all results contain
99          | osm_type | osm_id    | osm_key | osm_value | type  |
100          | way      | 396009653 | place   | house     | house |
101         And all results contain
102          | housenumber | street              | city       | county         | postcode | country       |
103          | 707         | Upper Kingston Road | Prattville | Autauga County | 36067    | United States |
104
105     Scenario: Reverse geocodejson - Interpolation address
106         When sending v1/reverse with format geocodejson
107           | lat       | lon        |
108           | 47.118533 | 9.57056562 |
109         Then a HTTP 200 is returned
110         And the result is valid geocodejson with 1 result
111         And all results contain
112           | osm_type | osm_id | osm_key | osm_value | type  |
113           | way      | 1      | place   | house     | house |
114         And all results contain
115           | label |
116           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
117         And all results have no attributes name
118
119     Scenario: Reverse geocodejson - Line geometry output is supported
120         When sending v1/reverse with format geocodejson
121           | lat      | lon     | polygon_geojson |
122           | 47.06597 | 9.50467 | 1  |
123         Then a HTTP 200 is returned
124         And the result is valid geocodejson with 1 result
125         And all results contain
126           | geojson+type |
127           | LineString   |
128
129     Scenario Outline: Reverse geocodejson - Only geojson polygons are supported
130         When sending v1/reverse with format geocodejson
131           | lat      | lon     | <param> |
132           | 47.06597 | 9.50467 | 1       |
133         Then a HTTP 200 is returned
134         And the result is valid geocodejson with 1 result
135         And all results contain
136           | geojson+type |
137           | Point        |
138
139         Examples:
140           | param |
141           | polygon_text |
142           | polygon_svg  |
143           | polygon_kml  |