File: with-schema.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-- 631 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
-- This config example file is released into the Public Domain.

-- This configuration for the flex output shows how to define a table in
-- a PostgreSQL schema.
--
-- This config file expects that you have a schema called `myschema` in
-- your database (created with something like `CREATE SCHEMA myschema;`).

local dtable = osm2pgsql.define_way_table('data', {
        { column = 'tags',  type = 'jsonb' },
        { column = 'geom',  type = 'linestring' },
    }, { schema = 'myschema' })

function osm2pgsql.process_way(object)
    dtable:insert({
        tags = object.tags,
        geom = object:as_linestring()
    })
end