]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/v1_xml.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / v1_xml.feature
1 Feature: XML output for Reverse API
2     Testing correctness of xml output (API version v1).
3
4     Scenario Outline: Reverse XML - Simple reverse-geocoding with no results
5         When sending v1/reverse
6           | lat   | lon   |
7           | <lat> | <lon> |
8         Then a HTTP 200 is returned
9         And the result is valid xml
10         And the result has no attributes osm_type, address, extratags
11         And the result contains
12           | error |
13           | Unable to geocode |
14
15         Examples:
16          | lat      | lon |
17          | 0.0      | 0.0 |
18          | 91.3     | 0.4    |
19          | -700     | 0.4    |
20          | 0.2      | 324.44 |
21          | 0.2      | -180.4 |
22
23     Scenario Outline: Reverse XML - OSM result with and without addresses
24         When sending v1/reverse with format xml
25           | lat    | lon   | addressdetails |
26           | 47.066 | 9.504 | <has_address>  |
27         Then a HTTP 200 is returned
28         And the result is valid xml
29         And the result has attributes place_id
30         And the result has <attributes> address
31         And the result contains
32           | osm_type | osm_id     | place_rank | address_rank |
33           | node     | 6522627624 | 30         | 30           |
34         And the result contains
35           | lon       | lat        | boundingbox |
36           | 9.5036065 | 47.0660892 | 47.0660392,47.0661392,9.5035565,9.5036565 |
37         And the result contains
38           | ref                   | display_name |
39           | Dorfbäckerei Herrmann | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
40
41         Examples:
42           | has_address | attributes     |
43           | 1           | attributes     |
44           | 0           | no attributes |
45
46     Scenario: Reverse XML - Tiger address
47         When sending v1/reverse with format xml
48           | lat           | lon            |
49           | 32.4752389363 | -86.4810198619 |
50         Then a HTTP 200 is returned
51         And the result is valid xml
52         And the result contains
53           | osm_type | osm_id    | place_rank  | address_rank |
54           | way      | 396009653 | 30          | 30           |
55         And the result contains
56           | lon         | lat        | boundingbox |
57           | -86.4808553 | 32.4753580 | 32.4753080,32.4754080,-86.4809053,-86.4808053 |
58         And the result contains
59           | display_name |
60           | 707, Upper Kingston Road, Upper Kingston, Prattville, Autauga County, 36067, United States |
61
62     Scenario: Reverse XML - Interpolation address
63         When sending v1/reverse with format xml
64           | lat       | lon        |
65           | 47.118533 | 9.57056562 |
66         Then a HTTP 200 is returned
67         And the result is valid xml
68         And the result contains
69           | osm_type | osm_id | place_rank | address_rank |
70           | way      | 1      | 30         | 30           |
71         And the result contains
72           | lon       | lat        | boundingbox |
73           | 9.5705468 | 47.1185454 | 47.1184954,47.1185954,9.5704968,9.5705968 |
74         And the result contains
75           | display_name |
76           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
77
78     Scenario: Reverse XML - Output of geojson
79         When sending v1/reverse with format xml
80           | lat      | lon     | polygon_geojson |
81           | 47.06597 | 9.50467 | 1               |
82         Then a HTTP 200 is returned
83         And the result is valid xml
84         And the result contains
85           | geojson |
86           | {"type":"LineString","coordinates":[[9.5039353,47.0657546],[9.5040437,47.0657781],[9.5040808,47.065787],[9.5054298,47.0661407]]}  |
87
88     Scenario: Reverse XML - Output of WKT
89         When sending v1/reverse with format xml
90           | lat      | lon     | polygon_text |
91           | 47.06597 | 9.50467 | 1            |
92         Then a HTTP 200 is returned
93         And the result is valid xml
94         And the result contains
95           | geotext!wkt |
96           | 9.5039353 47.0657546, 9.5040437 47.0657781, 9.5040808 47.065787, 9.5054298 47.0661407 |
97
98     Scenario: Reverse XML - Output of SVG
99         When sending v1/reverse with format xml
100           | lat      | lon     | polygon_svg |
101           | 47.06597 | 9.50467 | 1           |
102         Then a HTTP 200 is returned
103         And the result is valid xml
104         And the result contains
105           | geosvg |
106           | M 9.5039353 -47.0657546 L 9.5040437 -47.0657781 9.5040808 -47.065787 9.5054298 -47.0661407 |
107
108     Scenario: Reverse XML - Output of KML
109        When sending v1/reverse with format xml
110           | lat      | lon     | polygon_kml |
111           | 47.06597 | 9.50467 | 1           |
112         Then a HTTP 200 is returned
113         And the result is valid xml
114        And the result contains
115           | geokml!fm |
116           | <geokml><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></geokml> |