added bootstrap buildings

This commit is contained in:
2026-06-23 10:14:40 +03:00
parent bb996d0c98
commit 6797d9cabe
+8 -1
View File
@@ -1,6 +1,6 @@
local buildings = osm2pgsql.define_area_table('buildings', {
{ column = 'osm_id', type = 'bigint', not_null = true },
{ column = 'geom', type = 'geometry', projection = 4326, not_null = true },
{ column = 'geom', type = 'geometry', not_null = true },
{ column = 'height_m', type = 'real', not_null = true },
{ column = 'levels', type = 'int' },
{ column = 'building_type', type = 'text' },
@@ -46,6 +46,8 @@ local function building_height(tags)
return default_height(tags.building), nil, 'estimated'
end
local skipped = 0
local function add_building(object, geom)
if object.tags.building == nil or object.tags.building == 'no' then
return
@@ -64,7 +66,12 @@ local function add_building(object, geom)
end)
if not ok then
skipped = skipped + 1
if skipped <= 10 then
print('skip building ' .. tostring(object.id) .. ': ' .. tostring(err))
elseif skipped == 11 then
print('skip building: further geometry errors suppressed')
end
end
end