]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/reverse/v1_json.feature
make sure PHP and Python reverse code does the same
[nominatim.git] / test / bdd / api / reverse / v1_json.feature
1 @APIDB
2 Feature: Json output for Reverse API
3     Testing correctness of json and jsonv2 output (API version v1).
4
5     Scenario Outline: OSM result with and without addresses
6         When sending v1/reverse at 47.066,9.504 with format json
7           | addressdetails |
8           | <has_address>  |
9         Then result has <attributes> address
10         When sending v1/reverse at 47.066,9.504 with format jsonv2
11           | addressdetails |
12           | <has_address>  |
13         Then result has <attributes> address
14
15         Examples:
16           | has_address | attributes     |
17           | 1           | attributes     |
18           | 0           | not attributes |
19
20     Scenario Outline: Simple OSM result
21         When sending v1/reverse at 47.066,9.504 with format <format>
22         Then result has attributes place_id
23         And results contain
24           | licence |
25           | ^Data © OpenStreetMap contributors, ODbL 1.0. https?://osm.org/copyright$ |
26         And results contain
27           | osm_type | osm_id     |
28           | node     | 6522627624 |
29         And results contain
30           | centroid             | boundingbox |
31           | 9.5036065 47.0660892 | ['47.0660392', '47.0661392', '9.5035565', '9.5036565'] |
32         And results contain
33           | display_name |
34           | Dorfbäckerei Herrmann, 29, Gnetsch, Mäls, Balzers, Oberland, 9496, Liechtenstein |
35         And result has not attributes namedetails,extratags
36
37         Examples:
38           | format |
39           | json   |
40           | jsonv2 |
41
42     Scenario: Extra attributes of jsonv2 result
43         When sending v1/reverse at 47.066,9.504 with format jsonv2
44         Then result has attributes importance
45         Then results contain
46           | category | type   | name                  | place_rank | addresstype |
47           | shop     | bakery | Dorfbäckerei Herrmann | 30         | shop        |
48
49
50     @Tiger
51     Scenario: Tiger address
52         When sending v1/reverse at 32.4752389363,-86.4810198619 with format jsonv2
53         Then results contain
54          | osm_type | osm_id    | category | type  | addresstype  |
55          | way      | 396009653 | place    | house | place        |
56
57
58     Scenario Outline: Interpolation address
59         When sending v1/reverse at 47.118533,9.57056562 with format <format>
60         Then results contain
61           | osm_type | osm_id |
62           | way      | 1      |
63         And results contain
64           | centroid                | boundingbox |
65           | 9.57054676 47.118545392 | ^\['47.118495\d*', '47.118595\d*', '9.570496\d*', '9.570596\d*'\] |
66         And results contain
67           | display_name |
68           | 1019, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein |
69
70         Examples:
71           | format |
72           | json   |
73           | jsonv2 |
74
75
76     Scenario Outline: Output of geojson
77        When sending v1/reverse at 47.06597,9.50467 with format <format>
78           | param           | value |
79           | polygon_geojson | 1     |
80        Then results contain in field geojson
81           | type       | coordinates |
82           | LineString | [[9.5039353, 47.0657546], [9.5040437, 47.0657781], [9.5040808, 47.065787], [9.5054298, 47.0661407]] |
83
84        Examples:
85           | format |
86           | json   |
87           | jsonv2 |
88
89
90     Scenario Outline: Output of WKT
91        When sending v1/reverse at 47.06597,9.50467 with format <format>
92           | param        | value |
93           | polygon_text | 1     |
94        Then results contain
95           | geotext |
96           | LINESTRING(9.5039353 47.0657546,9.5040437 47.0657781,9.5040808 47.065787,9.5054298 47.0661407) |
97
98        Examples:
99           | format |
100           | json   |
101           | jsonv2 |
102
103
104     Scenario Outline: Output of SVG
105        When sending v1/reverse at 47.06597,9.50467 with format <format>
106           | param       | value |
107           | polygon_svg | 1     |
108        Then results contain
109           | svg |
110           | M 9.5039353 -47.0657546 L 9.5040437 -47.0657781 9.5040808 -47.065787 9.5054298 -47.0661407 |
111
112        Examples:
113           | format |
114           | json   |
115           | jsonv2 |
116
117
118     Scenario Outline: Output of KML
119        When sending v1/reverse at 47.06597,9.50467 with format <format>
120           | param       | value |
121           | polygon_kml | 1     |
122        Then results contain
123           | geokml |
124           | ^<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> |
125
126        Examples:
127           | format |
128           | json   |
129           | jsonv2 |