File: test_output_flex_nodes.lua

package info (click to toggle)
osm2pgsql 2.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,652 kB
  • sloc: cpp: 59,934; python: 1,039; ansic: 763; sh: 25; makefile: 14
file content (28 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (6)
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

local tables = {}

tables.t1 = osm2pgsql.define_node_table('osm2pgsql_test_t1', {
    { column = 'tags', type = 'hstore' },
    { column = 'geom', type = 'point' },
})

tables.t2 = osm2pgsql.define_node_table('osm2pgsql_test_t2', {
    { column = 'tags', type = 'hstore' },
    { column = 'geom', type = 'point' },
})

function osm2pgsql.process_node(object)
    if object.tags.t1 then
        tables.t1:insert({
            tags = object.tags,
            geom = object:as_point()
        })
    end
    if object.tags.t2 then
        tables.t2:insert({
            tags = object.tags,
            geom = object:as_point()
        })
    end
end