mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2026-01-17 13:31:07 +00:00
At some point we'll deprecate add_row(), tests that don't explicitly test add_row() should use insert().
26 lines
514 B
Lua
26 lines
514 B
Lua
|
|
local dtable = osm2pgsql.define_way_table('osm2pgsql_test_line', {
|
|
{ column = 'tags', type = 'hstore' },
|
|
{ column = 'geom', type = 'linestring' },
|
|
}, { schema = 'myschema' })
|
|
|
|
local delete_keys = {
|
|
'odbl',
|
|
'created_by',
|
|
'source'
|
|
}
|
|
|
|
local clean_tags = osm2pgsql.make_clean_tags_func(delete_keys)
|
|
|
|
function osm2pgsql.process_way(object)
|
|
if clean_tags(object.tags) then
|
|
return
|
|
end
|
|
|
|
dtable:insert({
|
|
tags = object.tags,
|
|
geom = object:as_linestring()
|
|
})
|
|
end
|
|
|