1 Feature: Import of entrance objects by osm2pgsql
2 Testing of correct setup of the entrance table
4 Scenario: Import simple entrance
7 n1 Tshop=sweets,entrance=yes,access=public x4.5 y-4
8 n2 Trouting:entrance=main x66.1 y0.1
9 n3 Tentrance=main,routing:entrance=foot x1 y2
12 Then place contains exactly
13 | object | class | type |
14 | N1 | shop | sweets |
15 | N4 | highway | bus_stop |
16 And place_entrance contains exactly
17 | osm_id | type | extratags!dict | geometry!wkt |
18 | 1 | yes | 'shop': 'sweets', 'access': 'public' | 4.5 -4 |
19 | 2 | main | - | 66.1 0.1 |
20 | 3 | main | - | 1 2 |
22 Scenario: Addresses and entrance information can exist on the same node
25 n1 Taddr:housenumber=10,addr:street=North,entrance=main
27 Then place contains exactly
28 | object | class | type | address+housenumber |
29 | N1 | place | house | 10 |
30 And place_entrance contains exactly
33 Scenario Outline: Entrance import can be disabled
34 Given the lua style file
36 local flex = require('import-full')
37 flex.set_entrance_filter<param>
41 n1 Tentrance=yes,access=public
42 n2 Trouting:entrance=main
44 Then place contains exactly
46 And place_entrance contains exactly
54 | {include={'access'}} |
57 Scenario: Entrance import can have custom main tags
58 Given the lua style file
60 local flex = require('import-full')
61 flex.set_entrance_filter{main_tags = {'door'}}
65 n1 Tentrance=yes,access=public
66 n2 Tdoor=foot,entrance=yes
68 Then place contains exactly
70 And place_entrance contains exactly
71 | osm_id | type | extratags!dict |
72 | 2 | foot | 'entrance': 'yes' |
74 Scenario: Entrance import can have custom extra tags included
75 Given the lua style file
77 local flex = require('import-full')
78 flex.set_entrance_filter{main_tags = {'entrance'},
79 extra_include = {'access'}}
83 n1 Tentrance=yes,access=public,shop=newspaper
84 n2 Tentrance=yes,shop=sweets
86 Then place_entrance contains exactly
87 | osm_id | type | extratags!dict |
88 | 1 | yes | 'access': 'public' |
91 Scenario: Entrance import can have custom extra tags excluded
92 Given the lua style file
94 local flex = require('import-full')
95 flex.set_entrance_filter{main_tags = {'entrance', 'door'},
96 extra_exclude = {'shop'}}
100 n1 Tentrance=yes,access=public,shop=newspaper
101 n2 Tentrance=yes,door=yes,shop=sweets
103 Then place_entrance contains exactly
104 | osm_id | type | extratags!dict |
105 | 1 | yes | 'access': 'public' |
108 Scenario: Entrance import can have a custom function
109 Given the lua style file
111 local flex = require('import-full')
112 flex.set_entrance_filter(function(object)
113 return {entrance='always', extratags = {ref = '1'}}
116 When loading osm data
118 n1 Tentrance=yes,access=public,shop=newspaper
121 Then place_entrance contains exactly
122 | osm_id | type | extratags!dict |
123 | 1 | always | 'ref': '1' |
124 | 2 | always | 'ref': '1' |