support for languages not in default.style

This commit is contained in:
Komzpa 2012-03-23 19:15:29 +03:00
parent e148ddfab9
commit 6ed38b3cf2

View file

@ -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",'абвгдезиклмнопрстуфьАБВГДЕЗИКЛМНОПРСТУФЬ','abvgdeziklmnoprstufABVGDEZIKLMNOPRSTUF'),'х','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 = {}