diff --git a/scripts/osm2pgsql_buildings.lua b/scripts/osm2pgsql_buildings.lua index bc0bd30..e73d2bc 100644 --- a/scripts/osm2pgsql_buildings.lua +++ b/scripts/osm2pgsql_buildings.lua @@ -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 - print('skip building ' .. tostring(object.id) .. ': ' .. tostring(err)) + 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