added bootstrap buildings
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
local buildings = osm2pgsql.define_area_table('buildings', {
|
local buildings = osm2pgsql.define_area_table('buildings', {
|
||||||
{ column = 'osm_id', type = 'bigint', not_null = true },
|
{ 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 = 'height_m', type = 'real', not_null = true },
|
||||||
{ column = 'levels', type = 'int' },
|
{ column = 'levels', type = 'int' },
|
||||||
{ column = 'building_type', type = 'text' },
|
{ column = 'building_type', type = 'text' },
|
||||||
@@ -46,6 +46,8 @@ local function building_height(tags)
|
|||||||
return default_height(tags.building), nil, 'estimated'
|
return default_height(tags.building), nil, 'estimated'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local skipped = 0
|
||||||
|
|
||||||
local function add_building(object, geom)
|
local function add_building(object, geom)
|
||||||
if object.tags.building == nil or object.tags.building == 'no' then
|
if object.tags.building == nil or object.tags.building == 'no' then
|
||||||
return
|
return
|
||||||
@@ -64,7 +66,12 @@ local function add_building(object, geom)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user