diff --git a/src/komap.py b/src/komap.py index 58137aa..5955178 100644 --- a/src/komap.py +++ b/src/komap.py @@ -205,8 +205,11 @@ if options.renderer == "mapnik": columnmap["name"] = ("""COALESCE("name:en","int_name", replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(translate("name",'абвгдезиклмнопрстуфьАБВГДЕЗИКЛМНОПРСТУФЬ','abvgdeziklmnoprstuf’ABVGDEZIKLMNOPRSTUF’'),'х','kh'),'Х','Kh'),'ц','ts'),'Ц','Ts'),'ч','ch'),'Ч','Ch'),'ш','sh'),'Ш','Sh'),'щ','shch'),'Щ','Shch'),'ъ','”'),'Ъ','”'),'ё','yo'),'Ё','Yo'),'ы','y'),'Ы','Y'),'э','·e'),'Э','E'),'ю','yu'),'Ю','Yu'),'й','y'),'Й','Y'),'я','ya'),'Я','Ya'),'ж','zh'),'Ж','Zh')) AS name""",('name:en','int_name',)) elif locale == "be": columnmap["name"] = ('COALESCE("name:be", "name:ru", "int_name", "name:en", "name") AS name',('name:be', "name:ru", "int_name", "name:en")) - elif locale: + elif locale and "name:"+locale in osm2pgsql_avail_keys or not osm2pgsql_avail_keys: columnmap["name"] = ('COALESCE("name:'+locale+'", "name") AS name',('name:'+locale,)) + elif locale: + columnmap["name"] = ("COALESCE(tags->'name:"+locale+'\', "name") AS name',('tags')) + mapped_cols = [i[0] for i in columnmap.values()] numerics = set() # set of number-compared things, like "population<10000" needs population as number, not text mapniksheet = {}