]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/reverse/v1_geocodejson.feature
Merge pull request #3003 from lonvia/rework-bdd-api-tests
[nominatim.git] / test / bdd / api / reverse / v1_geocodejson.feature
1 @APIDB
2 Feature: Geocodejson for Reverse API
3     Testing correctness of geocodejson output (API version v1).
4
5     Scenario Outline: Simple OSM result
6         When sending v1/reverse at 47.066,9.504 with format geocodejson
7           | addressdetails |
8           | <has_address>  |
9         Then result has attributes place_id, accuracy
10         And result has <attributes> country,postcode,county,city,district,street,housenumber, admin
11         Then results contain
12           | osm_type | osm_id     | osm_key | osm_value | type  |
13           | node     | 6522627624 | shop    | bakery    | house |
14         And results contain
15           | name                  | label |
16           | Dorfbäckerei Herrmann | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
17         And results contain in field geojson
18           | type  | coordinates             |
19           | Point | [9.5036065, 47.0660892] |
20         And results contain in field __geocoding
21           | version | licence | attribution |
22           | 0.1.0   | ODbL    | Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright |
23
24         Examples:
25           | has_address | attributes     |
26           | 1           | attributes     |
27           | 0           | not attributes |
28
29
30     Scenario: City housenumber-level address with street
31         When sending v1/reverse at 47.1068011,9.52810091 with format geocodejson
32         Then results contain
33           | housenumber | street    | postcode | city    | country |
34           | 8           | Im Winkel | 9495     | Triesen | Liechtenstein |
35          And results contain in field admin
36           | level6   | level8  |
37           | Oberland | Triesen |
38
39
40     Scenario: Town street-level address with street
41         When sending v1/reverse at 47.066,9.504 with format geocodejson
42           | zoom |
43           | 16 |
44         Then results contain
45           | name    | city    | postcode | country |
46           | Gnetsch | Balzers | 9496     | Liechtenstein |
47
48
49     Scenario: Poi street-level address with footway
50         When sending v1/reverse at 47.06515,9.50083 with format geocodejson
51         Then results contain
52           | street  | city    | postcode | country |
53           | Burgweg | Balzers | 9496     | Liechtenstein |
54
55
56     Scenario: City address with suburb
57         When sending v1/reverse at 47.146861,9.511771 with format geocodejson
58         Then results contain
59           | housenumber | street   | district | city  | postcode | country |
60           | 5           | Lochgass | Ebenholz | Vaduz | 9490     | Liechtenstein |
61
62
63     @Tiger
64     Scenario: Tiger address
65         When sending v1/reverse at 32.4752389363,-86.4810198619 with format geocodejson
66         Then results contain
67          | osm_type | osm_id    | osm_key | osm_value | type  |
68          | way      | 396009653 | place   | house     | house |
69         And results contain
70          | housenumber | street              | city       | county         | postcode | country       |
71          | 707         | Upper Kingston Road | Prattville | Autauga County | 36067    | United States |
72
73
74     Scenario: Interpolation address
75         When sending v1/reverse at 47.118533,9.57056562 with format geocodejson
76         Then results contain
77           | osm_type | osm_id | osm_key | osm_value | type  |
78           | way      | 1      | place   | house     | house |
79         And results contain
80           | label |
81           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
82         And result has not attributes name
83
84
85     Scenario: Line geometry output is supported
86         When sending v1/reverse at 47.06597,9.50467 with format geocodejson
87           | param           | value |
88           | polygon_geojson | 1     |
89         Then results contain in field geojson
90           | type       |
91           | LineString |
92
93
94     Scenario Outline: Only geojson polygons are supported
95         When sending v1/reverse at 47.06597,9.50467 with format geocodejson
96           | param   | value |
97           | <param> | 1     |
98         Then results contain in field geojson
99           | type  |
100           | Point |
101
102         Examples:
103           | param |
104           | polygon_text |
105           | polygon_svg  |
106           | polygon_kml  |