Files
osm2pgsql/tests/data/test_expire.lua
Jochen Topf be86625d91 Fix: Always disable expiry if maxzoom==0
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.
2025-10-27 12:57:36 +01:00

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