mirror of
https://github.com/osm2pgsql-dev/osm2pgsql.git
synced 2026-01-17 13:31:07 +00:00
maxzoom==0 is the default setting and it is documented to means that there is no expire. That's what the enabled() function checks. But disabling this in from_bbox() only disabled the expire for that case, not for linestrings. Better to do this check in the function that's called from outside the expire code: from_geometry(). We also need to fix some tests that were using maxzoom==0 by changing their setting to use maxzoom==1.
21 lines
480 B
Lua
21 lines
480 B
Lua
|
|
local eo = osm2pgsql.define_expire_output({
|
|
table = 'osm2pgsql_test_expire',
|
|
maxzoom = 1,
|
|
})
|
|
|
|
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
|
|
|