11-- This config example file is released into the Public Domain.
22--
3- -- This examples shows how to use tilesets for expire .
3+ -- This examples shows how to use tile expiry .
44
5- local tilesets = {}
5+ local expire_outputs = {}
66
7- tilesets .pois = osm2pgsql .define_tileset ({
8- -- Every tileset must have a name. The name is independent of the table
9- -- names although this example file uses the same name for simplicity.
7+ expire_outputs .pois = osm2pgsql .define_expire_output ({
8+ -- Every expire output must have a name. The name is independent of the
9+ -- data table names although this example file uses the same name for
10+ -- simplicity.
1011 name = ' pois' ,
1112 -- The zoom level at which we calculate the tiles. This must always be set.
1213 maxzoom = 14 ,
1314 -- The filename where tile list should be written to.
1415 filename = ' pois.tiles'
1516})
1617
17- tilesets .lines = osm2pgsql .define_tileset ({
18+ expire_outputs .lines = osm2pgsql .define_expire_output ({
1819 name = ' lines' ,
1920 maxzoom = 14 ,
2021 -- Instead of writing the tile list to a file, it can be written to a table.
@@ -23,7 +24,7 @@ tilesets.lines = osm2pgsql.define_tileset({
2324-- schema = 'myschema', -- You can also set a database schema.
2425})
2526
26- tilesets .polygons = osm2pgsql .define_tileset ({
27+ expire_outputs .polygons = osm2pgsql .define_expire_output ({
2728 name = ' polygons' ,
2829 -- You can also set a minimum zoom level in addition to the maximum zoom
2930 -- level. Tiles in all zoom levels between those two will be written out.
@@ -32,33 +33,33 @@ tilesets.polygons = osm2pgsql.define_tileset({
3233 table = ' polygons_tiles'
3334})
3435
35- print (" Tilesets :(" )
36- for name , ts in pairs (tilesets ) do
36+ print (" Expire outputs :(" )
37+ for name , eo in pairs (expire_outputs ) do
3738 print (" " .. name
38- .. " : name=" .. ts :name ()
39- .. " minzoom=" .. ts :minzoom ()
40- .. " maxzoom=" .. ts :maxzoom ()
41- .. " filename=" .. ts :filename ()
42- .. " schema=" .. ts :schema ()
43- .. " table=" .. ts :table ()
44- .. " (" .. tostring (ts ) .. " )" )
39+ .. " : name=" .. eo :name ()
40+ .. " minzoom=" .. eo :minzoom ()
41+ .. " maxzoom=" .. eo :maxzoom ()
42+ .. " filename=" .. eo :filename ()
43+ .. " schema=" .. eo :schema ()
44+ .. " table=" .. eo :table ()
45+ .. " (" .. tostring (eo ) .. " )" )
4546end
4647print (" )" )
4748
4849local tables = {}
4950
5051tables .pois = osm2pgsql .define_node_table (' pois' , {
5152 { column = ' tags' , type = ' jsonb' },
52- -- Zero, one or more tilesets are referenced in an `expire` field in
53+ -- Zero, one or more expire outputs are referenced in an `expire` field in
5354 -- the definition of any geometry column using the Web Mercator (3857)
5455 -- projection.
55- { column = ' geom' , type = ' point' , not_null = true , expire = { { tileset = ' pois' } } },
56+ { column = ' geom' , type = ' point' , not_null = true , expire = { { output = ' pois' } } },
5657})
5758
5859tables .lines = osm2pgsql .define_way_table (' lines' , {
5960 { column = ' tags' , type = ' jsonb' },
60- -- If you only have a single tileset you want to expire into and with
61- -- the defalt parameters, you can specify it directly.
61+ -- If you only have a single expire output and with the default
62+ -- parameters, you can specify it directly.
6263 { column = ' geom' , type = ' linestring' , not_null = true , expire = ' lines' },
6364})
6465
@@ -70,7 +71,9 @@ tables.polygons = osm2pgsql.define_area_table('polygons', {
7071 -- polygons where the width and height of the bounding box is below this
7172 -- limit the full area is expired, for larger polygons only the boundary.
7273 -- This setting doesn't have any effect on point or linestring geometries.
73- { column = ' geom' , type = ' geometry' , not_null = true , expire = { { tileset = ' polygons' , mode = ' boundary-only' } } },
74+ { column = ' geom' , type = ' geometry' , not_null = true , expire = {
75+ { output = ' polygons' , mode = ' boundary-only' }
76+ }}
7477})
7578
7679tables .boundaries = osm2pgsql .define_relation_table (' boundaries' , {
0 commit comments