]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/v1_geojson.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / v1_geojson.feature
1 Feature: Geojson for Reverse API
2     Testing correctness of geojson output (API version v1).
3
4     Scenario Outline: Reverse geojson - Simple with no results
5         When sending v1/reverse with format geojson
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 geojson - Simple OSM result
23         When sending v1/reverse with format geojson
24           | lat    | lon   | addressdetails |
25           | 47.066 | 9.504 | <has_address>  |
26         Then a HTTP 200 is returned
27         And the result is valid geojson with 1 result
28         And the result metadata contains
29           | licence!fm |
30           | Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright |
31         And all results have attributes place_id, importance
32         And all results have <attributes> address
33         And all results contain
34           | param               | value |
35           | osm_type            | node |
36           | osm_id              | 6522627624 |
37           | place_rank          | 30 |
38           | category            | shop |
39           | type                | bakery |
40           | addresstype         | shop |
41           | name                | Dorfbäckerei Herrmann |
42           | display_name        | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
43           | boundingbox         | [47.0660392, 47.0661392, 9.5035565, 9.5036565] |
44           | geojson+type        | Point |
45           | geojson+coordinates | [9.5036065, 47.0660892] |
46
47         Examples:
48           | has_address | attributes    |
49           | 1           | attributes    |
50           | 0           | no attributes |
51
52     Scenario: Reverse geojson - Tiger address
53         When sending v1/reverse with format geojson
54           | lat           | lon            |
55           | 32.4752389363 | -86.4810198619 |
56         Then a HTTP 200 is returned
57         And the result is valid geojson with 1 result
58         And all results contain
59           | osm_type | osm_id    | category | type  | addresstype  | place_rank |
60           | way      | 396009653 | place    | house | place        | 30         |
61
62     Scenario: Reverse geojson - Interpolation address
63         When sending v1/reverse with format geojson
64           | lat       | lon        |
65           | 47.118533 | 9.57056562 |
66         Then a HTTP 200 is returned
67         And the result is valid geojson with 1 result
68         And all results contain
69           | osm_type | osm_id | place_rank | category | type    | addresstype |
70           | way      | 1      | 30         | place    | house   | place       |
71         And all results contain
72           | boundingbox!in_box |
73           | 47.118494, 47.118596, 9.570495, 9.570597 |
74         And all results contain
75           | display_name |
76           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
77
78     Scenario: Reverse geojson - Line geometry output is supported
79         When sending v1/reverse with format geojson
80           | lat      | lon     | polygon_geojson |
81           | 47.06597 | 9.50467 | 1               |
82         Then a HTTP 200 is returned
83         And the result is valid geojson with 1 result
84         And all results contain
85           | geojson+type |
86           | LineString   |
87
88     Scenario Outline: Reverse geojson - Only geojson polygons are supported
89         When sending v1/reverse with format geojson
90           | lat      | lon     | <param> |
91           | 47.06597 | 9.50467 | 1       |
92         Then a HTTP 200 is returned
93         And the result is valid geojson with 1 result
94         And all results contain
95           | geojson+type |
96           | Point |
97
98         Examples:
99           | param |
100           | polygon_text |
101           | polygon_svg  |
102           | polygon_kml  |