Repository navigation
Conversation
|
I have most of the street spirit changes done, I just need to review and commit |
|
From shortbread-tiles/shortbread-docs#68 (comment), it seemed like the discussion was going in the direction of treating |
Tagging frequency does not work thanks to If someone had a function that returns if a string is a valid IETF language tag I could use that but I didn't see any. I also didn't see any comprehensive lists of what is a valid language tag. The list of languages being >100 long does imply that I need to change the algorithm. Currently it loops through the languages, looking for name tags that match the language. Instead I should loop through tags, looking for name tags and then extracting the language from them to test against a list of languages. |
Sure, Planetiler has one. It used to be based on a rudimentary regular expression that covers like 99.997% of OSM data, but for completeness, I deprecated it in onthegomap/planetiler#1404 in favor of running each subkey by Java’s built-in
A whitelist would be impractical, because a language tag can contain so much information that one can mix and match. Given a list of OSM keys in use, you could choose to blacklist certain patterns, such as |
Would that consider |
|
Both the regular expression and its replacement reject noncanonical spellings due to conflict with a different tagging scheme for the name according to some public transport operator. |
I just tried this out in the revised function. Java’s As a point of reference, OpenHistoricalMap’s tile generator accepts any valid IETF language tag, except that it discards any valid IETF language tag if the subkey has fewer than five occurrences. It still brings in the bogus |
Is this the only thing blocking adding more languages for the spirit shortbread implementation? If so, I can add a function for it( porting language-tags/langcodes ) in lua. Should that live here or themepark or as a separate luarocks package? |
|
I have put it out in a gist to show how it looks like - https://gist.github.com/ramSeraph/1af8e77fcfd3d800f0b57da44c470cdf. Hope this helps with deciding on how to approach this. |
|
I don't want to merge this yet because it would require a DB reload and then another DB reload when more languages are added to shortbread. |
This converts the name logic to a list of names rather than only en and de. Although currently only a subset of languages are in the tiles this can be easily extended in the future.
This accepts valid languages with at least 50 uses in OSM
This converts the name logic to a list of names rather than only en and de. Although currently only en and de are in the list it allows the list to be easily extended when the spec is changed.