Skip to content

Add all name:* keys to the vector tiles #679

Closed

Description

@jeffreyameyer

What's your idea for a cool feature that would help you use OHM better.
As preparation for multilingual label / browser locale label support, we should add all name:* keys to the vector tiles.

Current workarounds
None, as only the base name key is currently available in the vector tiles.

See: #481

Activity

  1. jeffreyameyer commented on May 29, 2024

    @jeffreyameyer
    MemberAuthor

    @Rub21 - can we add these name:*=* values to the land_ohm_centroids layer now?

  2. 1ec5 commented on May 29, 2024

    @1ec5
    Member

    As a reminder, this isn’t specific to any particular layer: any layer that exposes name should also expose name:*.

    There are a few subkeys we might not want to expose, such as name:pronunciation and name:etymology. Now that we’ve settled on name:source instead of source:name, we’ll need to exclude that key too. (We might need to restore it later, in a different form, as part of #559.) A regular expression such as ^name:\w{2,3}(-[^:]+)?$ should match every name key that we would want to expose.

  3. Rub21 commented on Jul 26, 2024

    @Rub21
    Member

    @jeffreyameyer @1ec5 do you have some objects as example in OHM?

  4. jeffreyameyer commented on Jul 26, 2024

    @jeffreyameyer
    MemberAuthor

    Here's the HRE chronology relation with multiple localized names. The member relations also have localized names. And... the members of those relations (E.g., HRE 962-1002), should be any number of member states (E.g., Duchy of Lotharingia) with multiple name strings.

    I'm sure there's a clever Overpass Turbo query @1ec5 could provide to generate a more thorough list, but that's beyond the range of my immediate memory / Overpass-fu.

  5. Rub21 commented on Jul 29, 2024

    @Rub21
    Member

    I have implemented support for all languages listed in the Language-related subkeys section. Those already visible in vtiles staging:

    https://vtiles.staging.openhistoricalmap.org/#20/37.6994257/36.592885
    image

    https://vtiles.staging.openhistoricalmap.org/#13.78/51.89969/21.25611
    image

    However, in some cases, like Jeff's example, some language names are not displaying, such as name:nds_nl and name:nds. Those attributes has not been imported into the database. It seems to be an issue with imposm, so I have updated the version of the imposm container, but even so, those attributes are not appearing yet. Maybe some other configuration in imposm is required. I am going to dive deeper into this, but the other common languages are already in the vtiles staging and ready for testing.

  6. Rub21 commented on Jul 29, 2024

    @Rub21
    Member

    It seems Jeff’s example has issues in the data: https://www.openhistoricalmap.org/relation/2750624. I have added boundary=administrative to the relation, but it is not clear which members are part of the relation.

    Additionally, I found another relation: https://www.openhistoricalmap.org/relation/2805484, which is related to the Roman Empire. This one is fine, and the language tags are displaying correctly.
    Screenshot 2024-07-29 at 9 12 11 AM

    @vknoppkewetzel This is ready for styling!

  7. moved this from Todo - Known Path to On Staging in OpenHistoricalMap Dev Planningon Jul 29, 2024
  8. 1ec5 commented on Jul 29, 2024

    @1ec5
    Member

    I have implemented support for all languages listed in the Language-related subkeys section. Those already visible in vtiles staging:

    This works for now, though I’m not sure this will be a scalable solution long-term. OpenHistoricalMap/ohm-deploy@15e5a39 enumerates a ton of languages explicitly, presumably because you need each one in a separate column. But even the expansive list on that wiki page will eventually be inadequate, because OHM will likely care about historical languages too. (Also, name:left is a valid key but not for language support.)

    Would it be possible to add fields based on the regular expression in #679 (comment)? The general syntax is name: followed by any valid IETF language tag according to the BCP 47 standard. You could store the names in an hstore to avoid having to write out each column by hand. go-spatial/tegola-docs#8 says Tegola does support hstores in this manner.

    However, in some cases, like Jeff's example, some language names are not displaying, such as name:nds_nl and name:nds.

    Dutch Low Saxon should be name:nds-NL, rather than name:nds_nl, based on the BCP 47 standard.

  9. Rub21 commented on Jul 29, 2024

    @Rub21
    Member

    Tegola displays attributes according to the columns. so I was testing two approaches:

    • Using Regex in a function, where the tags (hstore) are passed as an argument to the function, it returns a list of filtered name:*. The function performs an evaluation with a loop over each key/value, which takes time according to the number of tags. This query is more expensive and takes longer to complete a tile request.

    • The list is based on hstore https://github.com/OpenHistoricalMap/ohm-deploy/blob/staging/images/tiler-server/config/lenguages.sql , the column tags is hstore data-type in the database . Basically, we are using hstore in the database and to get valalues from it , we run tags -> 'name:ab' AS name_ab. I understand the list could be lengthy, but it takes almost the same time as a request without the language filters. Tegola handles null values effectively. so Currently, this woudl be the best approach, considering the time it takes.

    Regarding Tegola's support for hstore, go-spatial/tegola-docs#8, I believe it refers to what we already use: tags -> 'name:ab' AS name_ab.

    name:left is a valid key but not for language support.)

    I am going to to remove that key/value

    Dutch Low Saxon should be name:nds-NL, rather than name:nds_nl, based on the BCP 47 standard.

    I think this section is related to data

  10. 1ec5 commented on Jul 29, 2024

    @1ec5
    Member

    I understand the list could be lengthy, but it takes almost the same time as a request without the language filters. Tegola handles null values effectively. so Currently, this woudl be the best approach, considering the time it takes.

    OK, that’s pretty impressive then. At least images/tiler-server/config/lenguages.sql is pretty straightforward for us to modify in the future if we need to add more languages.

    Looking through that file, I think we should add some script-qualified codes as well:

    Here are additional modern languages that are in use in the OHM database, from most common to least common:

    Here are additional historical languages that are in use in the OHM database, from most common to least common:

    A user is considerably less likely to be using a browser in one of these historic languages, but they might choose to enable it in their OHM settings or using a URL parameter.

    The lists above only include valid, non-deprecated codes.

  11. Rub21 commented on Jul 31, 2024

    @Rub21
    Member

    I have added the additional languages. Since the column labels do not support : and - signs, they have all been replaced with _(underscore). Therefore, tags like:

    • name:mkh-x-mvi -> name_mkh_x_mvi.
    • name:nci -> name_nci
  12. danrademacher commented on Aug 27, 2024

    @danrademacher

    This is done and deployed to staging and prod

  13. added theissue type on Mar 16, 2025
  14. added
    internationalization
    and removed on Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

internationalizationvtiles

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions