mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 04:21:08 +00:00
Clean-up of LanguageUtils (#200)
* string() and transliteratedName() used only here, so moved here from LanguageUtils * use string() from OmtLanguageUtils
This commit is contained in:
@@ -114,10 +114,18 @@ public class OmtLanguageUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String string(Object obj) {
|
||||
return nullIfEmpty(obj == null ? null : obj.toString());
|
||||
}
|
||||
|
||||
public static String transliteratedName(Map<String, Object> tags) {
|
||||
return Translations.transliterate(string(tags.get("name")));
|
||||
}
|
||||
|
||||
private static Stream<String> getAllNameTranslationsBesidesEnglishAndGerman(Map<String, Object> tags) {
|
||||
return tags.entrySet().stream()
|
||||
.filter(e -> !EN_DE_NAME_KEYS.contains(e.getKey()) && VALID_NAME_TAGS.test(e.getKey()))
|
||||
.map(Map.Entry::getValue)
|
||||
.map(LanguageUtils::string);
|
||||
.map(OmtLanguageUtils::string);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user