File: test_expire.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 (20 lines) | stat: -rw-r--r-- 490 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

-- No maxzoom sets it to 0
local eo = osm2pgsql.define_expire_output({
    table = 'osm2pgsql_test_expire',
})

local the_table = osm2pgsql.define_way_table('osm2pgsql_test_t1', {
    { column = 'tags', type = 'hstore' },
    { column = 'geom', type = 'linestring', expire = {{ output = eo }} },
})

function osm2pgsql.process_way(object)
    if object.tags.t1 then
        the_table:insert{
            tags = object.tags,
            geom = object:as_linestring()
        }
    end
end