[Tile-serving] [osm2pgsql-dev/osm2pgsql] Error when generalizing tables using osm2pgsql-gen (Issue #2443)
Martin Ždila
notifications at github.com
Mon Jan 5 18:45:58 UTC 2026
zdila created an issue (osm2pgsql-dev/osm2pgsql#2443)
## What version of osm2pgsql are you using?
```
osm2pgsql version 2.2.0 (2.2.0-32-gc51bb834)
Build: Release
Compiled using the following library versions:
Libosmium 2.22.0
Proj 9.7.1
nlohmann JSON 3.11.3
Lua 5.1.4
```
## What operating system and PostgreSQL/PostGIS version are you using?
Debian 18.1-2
PostGIS version: 3.6
## What did you do exactly?
### Command and logs:
<details>
<summary>/home/martin/fm/osm2pgsql/build/osm2pgsql-gen --log-sql --log-sql-data</summary>
```
/home/martin/fm/osm2pgsql/build/osm2pgsql-gen --log-sql --log-sql-data
2026-01-05 19:38:44 osm2pgsql-gen version 2.2.0 (2.2.0-32-gc51bb834)
2026-01-05 19:38:44 WARNING: This is an EXPERIMENTAL extension to osm2pgsql.
2026-01-05 19:38:44 SQL: (C0) SELECT pg_backend_pid()
2026-01-05 19:38:44 SQL: (C0) New database connection (context=gen.check, backend_pid=3273518)
2026-01-05 19:38:44 SQL: (C0) SET client_min_messages = WARNING
2026-01-05 19:38:44 SQL: (C0) SET synchronous_commit = off
2026-01-05 19:38:44 SQL: (C0) SELECT name, setting FROM pg_catalog.pg_settings
2026-01-05 19:38:44 SQL: (C0) SELECT current_catalog
2026-01-05 19:38:44 SQL: (C0) SELECT regexp_split_to_table(extversion, '\.') FROM pg_catalog.pg_extension WHERE extname='postgis'
2026-01-05 19:38:44 SQL: (C0) SELECT oid FROM pg_type WHERE typname='geometry'
2026-01-05 19:38:44 Database version: 18.1 (Debian 18.1-2)
2026-01-05 19:38:44 PostGIS version: 3.6
2026-01-05 19:38:44 SQL: (C0) SELECT extname FROM pg_catalog.pg_extension WHERE true
2026-01-05 19:38:44 SQL: (C0) SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname !~ '^pg_' AND nspname <> 'information_schema'
2026-01-05 19:38:44 SQL: (C0) SELECT spcname FROM pg_catalog.pg_tablespace WHERE spcname != 'pg_global'
2026-01-05 19:38:44 SQL: (C0) SELECT amname FROM pg_catalog.pg_am WHERE amtype = 'i'
2026-01-05 19:38:44 SQL: (C0) SELECT schemaname || '.' || tablename FROM pg_catalog.pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
2026-01-05 19:38:44 Loading properties from table '"public"."osm2pgsql_properties"'.
2026-01-05 19:38:44 SQL: (C1) SELECT pg_backend_pid()
2026-01-05 19:38:44 SQL: (C1) New database connection (context=prop.load, backend_pid=3273529)
2026-01-05 19:38:44 SQL: (C1) SET client_min_messages = WARNING
2026-01-05 19:38:44 SQL: (C1) SET synchronous_commit = off
2026-01-05 19:38:44 SQL: (C1) SELECT * FROM "public"."osm2pgsql_properties"
2026-01-05 19:38:44 SQL: (C2) SELECT pg_backend_pid()
2026-01-05 19:38:44 SQL: (C2) New database connection (context=gen.proc, backend_pid=3273530)
2026-01-05 19:38:44 SQL: (C2) SET client_min_messages = WARNING
2026-01-05 19:38:44 SQL: (C2) SET synchronous_commit = off
2026-01-05 19:38:44 SQL: (C2) PREPARE insert_geoms AS
INSERT INTO "public"."osm_landusages_gen0" ("geometry", x, y) VALUES ($1::geometry, $2::int, $3::int)
2026-01-05 19:38:44 SQL: (C2) PREPARE get_geoms AS
SELECT "geometry", NULL AS param
FROM "public"."osm_landusages"
WHERE "geometry" &&
ST_MakeEnvelope($1::real, $2::real, $3::real, $4::real, 3857)
2026-01-05 19:38:44 Running generalizer 'osm_landusages_gen0' (raster-union)...
2026-01-05 19:38:44 SQL: (C2) SELECT 1 FROM "public"."osm_landusages" LIMIT 1
2026-01-05 19:38:44 SQL: (C2) SELECT ST_XMin(e), ST_YMin(e), ST_XMax(e), ST_YMax(e) FROM ST_EstimatedExtent('public', 'osm_landusages', 'geometry') AS e
2026-01-05 19:38:44 SQL: (C2) BEGIN
2026-01-05 19:38:44 SQL: (C2) EXECUTE get_geoms(2504688.5425000004,6026906.805390624,2582960.059453126,6105178.32234375)
2026-01-05 19:38:44 SQL: (C2) COMMIT
2026-01-05 19:38:44 SQL: (C2) BEGIN
2026-01-05 19:38:44 SQL: (C2) EXECUTE get_geoms(2504688.5425000004,6105178.32234375,2582960.059453126,6183449.8392968755)
2026-01-05 19:38:44 SQL: (C2) COMMIT
2026-01-05 19:38:44 SQL: (C2) BEGIN
2026-01-05 19:38:44 SQL: (C2) EXECUTE get_geoms(2504688.5425000004,6183449.8392968755,2582960.059453126,6261721.356249999)
2026-01-05 19:38:44 SQL: (C2) EXECUTE insert_geoms(,288,176,)
2026-01-05 19:38:44 ERROR: SQL command failed: EXECUTE insert_geoms(,288,176,)
2026-01-05 19:38:44 ERROR: Failed to execute Lua function 'osm2pgsql.process_gen': /home/martin/fm/maprender/osm2pgsql.lua:1879: Error in 'run_gen': Database error: ERROR: bind message supplies 4 parameters, but prepared statement "insert_geoms" requires 3
(7)
.
```
</details>
### Lua config
```
--- at type OsmColumnDef[]
local landusage_columns = {
{ column = "geometry", type = "geometry", projection = projection, not_null = true },
{ column = "name", type = "text" },
{ column = "type", type = "text" },
{ column = "area", type = "real", not_null = true },
{ column = "tags", type = "hstore", not_null = true },
}
tables.landusages = osm2pgsql.define_table({
name = "osm_landusages",
cluster = "no",
ids = area_pk,
columns = landusage_columns
})
tables.landusages_gen1 = osm2pgsql.define_table({
name = "osm_landusages_gen1",
cluster = "no",
ids = { type = "tile" },
columns = landusage_columns
})
tables.landusages_gen0 = osm2pgsql.define_table({
name = "osm_landusages_gen0",
cluster = "no",
ids = { type = "tile" },
columns = landusage_columns
})
function osm2pgsql.process_gen()
osm2pgsql.run_gen(
'raster-union',
{
name = "osm_landusages_gen0",
cluster = "no",
src_table = "osm_landusages",
dest_table = "osm_landusages_gen0",
geom_column = "geometry",
zoom = 9
}
);
osm2pgsql.run_gen(
'raster-union',
{
name = "osm_landusages_gen1",
cluster = "no",
src_table = "osm_landusages",
dest_table = "osm_landusages_gen1",
geom_column = "geometry",
zoom = 11
}
);
end
```
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2443
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/issues/2443 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20260105/661ad94b/attachment.htm>
More information about the Tile-serving
mailing list