+--------- Convenience functions for simple style configuration -----------------
+
+
+function module.set_prefilters(data)
+ PRE_DELETE = module.tag_match{keys = data.delete_keys, tags = data.delete_tags}
+ PRE_EXTRAS = module.tag_match{keys = data.extra_keys,
+ tags = data.extra_tags}
+end
+
+function module.set_main_tags(data)
+ MAIN_KEYS = data
+end
+
+function module.set_name_tags(data)
+ NAMES = module.tag_group(data)
+end
+
+function module.set_address_tags(data)
+ if data.postcode_fallback ~= nil then
+ POSTCODE_FALLBACK = data.postcode_fallback
+ data.postcode_fallback = nil
+ end
+
+ ADDRESS_TAGS = module.tag_group(data)
+end
+
+function module.set_unused_handling(data)
+ if data.extra_keys == nil and data.extra_tags == nil then
+ POST_DELETE = module.tag_match{keys = data.delete_keys, tags = data.delete_tags}
+ SAVE_EXTRA_MAINS = function() return true end
+ elseif data.delete_keys == nil and data.delete_tags == nil then
+ POST_DELETE = nil
+ SAVE_EXTRA_MAINS = module.tag_match{keys = data.extra_keys, tags = data.extra_tags}
+ else
+ error("unused handler can have only 'extra_keys' or 'delete_keys' set.")
+ end
+end
+
+function set_relation_types(data)
+ module.RELATION_TYPES = {}
+ for k, v in data do
+ if v == 'multipolygon' then
+ module.RELATION_TYPES[k] = module.relation_as_multipolygon
+ elseif v == 'multiline' then
+ module.RELATION_TYPES[k] = module.relation_as_multiline
+ end
+ end
+end