X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7d911f9ffbdf63b2b2a45c3a3ee7063d006a5779..0eb31d8f70d3a04bfc7135081be70a2775f8ae97:/settings/flex-base.lua?ds=sidebyside diff --git a/settings/flex-base.lua b/settings/flex-base.lua index fbfb4d54..7860737f 100644 --- a/settings/flex-base.lua +++ b/settings/flex-base.lua @@ -5,6 +5,7 @@ local module = {} local PRE_DELETE = nil local PRE_EXTRAS = nil +local POST_DELETE = nil local MAIN_KEYS = nil local NAMES = nil local ADDRESS_TAGS = nil @@ -30,6 +31,8 @@ local place_table = osm2pgsql.define_table{ { column = 'extratags', type = 'hstore' }, { column = 'geometry', type = 'geometry', projection = 'WGS84', not_null = true }, }, + data_tablespace = os.getenv("NOMINATIM_TABLESPACE_PLACE_DATA"), + index_tablespace = os.getenv("NOMINATIM_TABLESPACE_PLACE_INDEX"), indexes = {} } @@ -224,7 +227,7 @@ function Place:write_row(k, v, save_extra_mains) if self.geometry == nil then self.geometry = self.geom_func(self.object) end - if self.geometry:is_null() then + if self.geometry == nil or self.geometry:is_null() then return 0 end @@ -247,9 +250,9 @@ function Place:write_row(k, v, save_extra_mains) } if save_extra_mains then - for k, v in pairs(self.object.tags) do - if save_extra_mains(k, v) then - self.extratags[k] = nil + for tk, tv in pairs(self.object.tags) do + if save_extra_mains(tk, tv) then + self.extratags[tk] = nil end end end @@ -405,6 +408,9 @@ function module.process_way(object) if geom:is_null() then geom = o:as_linestring() + if not geom:is_null() and geom:length() > 30 then + return nil + end end return geom @@ -537,7 +543,7 @@ function module.set_unused_handling(data) end end -function set_relation_types(data) +function module.set_relation_types(data) module.RELATION_TYPES = {} for k, v in data do if v == 'multipolygon' then