File: table-ids.feature

package info (click to toggle)
osm2pgsql 2.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,772 kB
  • sloc: cpp: 60,940; python: 1,115; ansic: 763; sh: 25; makefile: 14
file content (57 lines) | stat: -rw-r--r-- 1,503 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Feature: Test for correct id column generation

    Background:
        Given the 0.1 grid
           | 1 |   |  2 |
           | 3 |   |  4 |

    Scenario: Data can be inserted into tables without an iD column
        Given the lua style
            """
            local simple = osm2pgsql.define_table{
                name = 'simple',
                columns = {{ column = 'id', type = 'bigint'}}
            }

            function osm2pgsql.process_node(object)
                simple:insert{ id = object.id }
            end

            function osm2pgsql.process_way(object)
                simple:insert{ id = object.id }
            end

            function osm2pgsql.process_relation(object)
                simple:insert{ id = object.id }
            end
            """
        And the OSM data
            """
            n1 Tp=1
            n2 Tp=2
            w10 Tp=10 Nn1,n2,n4
            r100 Tp=100 Mn1@,n2@
            """
        When running osm2pgsql flex with parameters
            | --slim |
        Then table simple contains
            | id  |
            | 1   |
            | 2   |
            | 10  |
            | 100 |
        Given the OSM data
            """
            n1 v2 dD
            w11 Tp=11 Nn1,n3
            """
        When running osm2pgsql flex with parameters
            | --slim | -a |
        Then table simple contains
            | id  |
            | 1   |
            | 2   |
            | 10  |
            | 11  |
            | 100 |