]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/osm2pgsql/import/simple.feature
release 5.3.2.post9
[nominatim.git] / test / bdd / features / osm2pgsql / import / simple.feature
1 Feature: Import of simple objects by osm2pgsql
2     Testing basic tagging in osm2pgsql imports.
3
4     Scenario: Import simple objects
5         When loading osm data
6           """
7           n1 Tamenity=prison,name=foo x34.3 y-23
8           n100 x0 y0
9           n101 x0 y0.1
10           n102 x0.1 y0.2
11           n200 x0 y0
12           n201 x0 y1
13           n202 x1 y1
14           n203 x1 y0
15           w1 Tshop=toys,name=tata Nn100,n101,n102
16           w2 Tref=45 Nn200,n201,n202,n203,n200
17           r1 Ttype=multipolygon,tourism=hotel,name=XZ Mn1@,w2@
18           """
19         Then place contains exactly
20           | object | class   | type   | name!dict       | geometry!wkt |
21           | N1     | amenity | prison | 'name' : 'foo'  | 34.3 -23 |
22           | W1     | shop    | toys   | 'name' : 'tata' | 0 0, 0 0.1, 0.1 0.2 |
23           | R1     | tourism | hotel  | 'name' : 'XZ'   | (0 0, 0 1, 1 1, 1 0, 0 0) |
24
25     Scenario: Import object with two main tags
26         When loading osm data
27           """
28           n1 Ttourism=hotel,amenity=restaurant,name=foo
29           """
30         Then place contains exactly
31           | object | class   | type       | name!dict      | categories!set                                |
32           | N1     | amenity | restaurant | 'name' : 'foo' | 'osm.tourism.hotel', 'osm.amenity.restaurant' |
33
34     Scenario: Import stand-alone house number with postcode
35         When loading osm data
36           """
37           n1 Taddr:housenumber=4,addr:postcode=3345
38           """
39         Then place contains exactly
40           | object | class | type |
41           | N1     | place | house |
42
43     Scenario Outline: Tags used by Nominatim internally are always imported
44         Given the lua style file
45             """
46             local flex = require('import-<style>')
47             """
48         When loading osm data
49             """
50             n1 Tboundary=administrative,place=city,name=Foo,wikipedia:de=Foo
51             n2 Tplace=hamlet,wikidata=Q1234321,name=Bar
52             """
53         Then place contains exactly
54            | object | class    | extratags!dict         | categories!set                                  |
55            | N1     | boundary | 'wikipedia:de': 'Foo'  | 'osm.boundary.administrative', 'osm.place.city' |
56            | N2     | place    | 'wikidata': 'Q1234321' | 'osm.place.hamlet'                              |
57
58         Examples:
59            | style   |
60            | admin   |
61            | street  |
62            | address |
63            | full    |
64            | extratags |