]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/geometry.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / geometry.feature
1 Feature: Geometries for reverse geocoding
2     Tests for returning geometries with reverse
3
4     Scenario: Reverse - polygons are returned fully by default
5         When sending v1/reverse
6           | lat      | lon     | polygon_text |
7           | 47.13803 | 9.52264 | 1            |
8         Then a HTTP 200 is returned
9         And the result is valid xml
10         And the result contains
11           | geotext!fm |
12           | POLYGON\(\(9.5225302 47.138066, ?9.5225348 47.1379282, ?9.5226142 47.1379294, ?9.5226143 47.1379257, ?9.522615 47.137917, ?9.5226225 47.1379098, ?9.5226334 47.1379052, ?9.5226461 47.1379037, ?9.5226588 47.1379056, ?9.5226693 47.1379107, ?9.5226762 47.1379181, ?9.5226762 47.1379268, ?9.5226761 47.1379308, ?9.5227366 47.1379317, ?9.5227352 47.1379753, ?9.5227608 47.1379757, ?9.5227595 47.1380148, ?9.5227355 47.1380145, ?9.5227337 47.1380692, ?9.5225302 47.138066\)\) |
13
14
15     Scenario: Reverse - polygons can be slightly simplified
16         When sending v1/reverse
17           | lat      | lon     | polygon_text | polygon_threshold |
18           | 47.13803 | 9.52264 | 1            | 0.00001            |
19         Then a HTTP 200 is returned
20         And the result is valid xml
21         And the result contains
22           | geotext!fm |
23           | POLYGON\(\(9.5225302 47.138066, ?9.5225348 47.1379282, ?9.5226142 47.1379294, ?9.5226225 47.1379098, ?9.5226588 47.1379056, ?9.5226761 47.1379308, ?9.5227366 47.1379317, ?9.5227352 47.1379753, ?9.5227608 47.1379757, ?9.5227595 47.1380148, ?9.5227355 47.1380145, ?9.5227337 47.1380692, ?9.5225302 47.138066\)\) |
24
25
26     Scenario: Reverse - polygons can be much simplified
27         When sending v1/reverse
28           | lat      | lon     | polygon_text | polygon_threshold |
29           | 47.13803 | 9.52264 | 1            | 0.9               |
30         Then a HTTP 200 is returned
31         And the result is valid xml
32         And the result contains
33           | geotext!fm |
34           | POLYGON\(\([0-9. ]+, ?[0-9. ]+, ?[0-9. ]+, ?[0-9. ]+(, ?[0-9. ]+)?\)\) |
35
36
37     Scenario: Reverse - for polygons return the centroid as center point
38         When sending v1/reverse
39           | lat      | lon     |
40           | 47.13836 | 9.52304 |
41         Then a HTTP 200 is returned
42         And the result is valid xml
43         And the result contains
44           | lon       | lat        |
45           | 9.5227108 | 47.1381805 |
46
47
48     Scenario: Reverse - for streets return the closest point as center point
49         When sending v1/reverse
50           | lat      | lon     |
51           | 47.13368 | 9.52942 |
52         Then a HTTP 200 is returned
53         And the result is valid xml
54         And the result contains
55           | lon       | lat        |
56           | 9.5294315 | 47.1336817 |