]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/osm2pgsql/import/simple.feature
force inclusion of extratags used directly by Nominatim
[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      |
32           | N1     | tourism | hotel      | 'name' : 'foo' |
33           | N1     | amenity | restaurant | 'name' : 'foo' |
34
35     Scenario: Import stand-alone house number with postcode
36         When loading osm data
37           """
38           n1 Taddr:housenumber=4,addr:postcode=3345
39           """
40         Then place contains exactly
41           | object | class | type |
42           | N1     | place | house |
43
44     Scenario Outline: Tags used by Nominatim internally are always imported
45         Given the lua style file
46             """
47             local flex = require('import-<style>')
48             """
49         When loading osm data
50             """
51             n1 Tboundary=administrative,place=city,name=Foo,wikipedia:de=Foo
52             n2 Tplace=hamlet,wikidata=Q1234321,name=Bar
53             """
54         Then place contains exactly
55            | object | class    | extratags!dict         |
56            | N1     | boundary | 'place': 'city', 'wikipedia:de': 'Foo' |
57            | N2     | place    | 'wikidata': 'Q1234321' |
58
59         Examples:
60            | style   |
61            | admin   |
62            | street  |
63            | address |
64            | full    |
65            | extratags |