Skip to content

Append date ranges to object labels in JOSM #1003

Closed

Description

@1ec5

JOSM should automatically append the start and end date to each element’s label.

Rationale

Mappers have historically appended date ranges to name=* in order to distinguish copies of the same feature that share the same name, especially boundary relations representing the same polity over time. This is unfortunate tagging for the editor. As of OpenHistoricalMap/iD#184 and OpenHistoricalMap/ohm-website#277, start_date=* and end_date=* are automatically appended to element labels in iD and the website, respectively, reducing the need for this workaround.

JOSM is the last holdout, still labeling elements by name=* alone in a number of locations, including the Selection, Relations, and Validation Results sidebar panels. Most mappers who specialize in large features like boundaries and railways prefer JOSM, so they’re understandably reluctant to abandon the hard-coded date ranges.

JOSM’s Selection, Relations, and Validation Results sidebar panels listing multiple relations as Central Time Zone.

Implementation notes

We haven’t forked JOSM like we’ve forked other parts of the OSM software stack, so we’re dependent on the customization options it provides out of the box.

I had been led to believe that you could customize the format using relation.nameOrder, but unfortunately this is just a list of key names, not the full name template syntax. That syntax is only available for presets. We should publish our own presets (#556), but a preset pack for every common feature type would be quite unmanageable.

Apart from those settings, JOSM’s label formats for general features and relations are hard-coded in DefaultNameFormatter. Despite the name, several parts of the codebase instantiate a DefaultNameFormatter directly without any abstraction.

It’s unclear to me whether a plugin could override DefaultNameFormatter somehow. If so, it would make some sense to publish such a plugin. Otherwise, we might have to ask the JOSM developers to unconditionally include logic to append start_date=* and end_date=* whenever it appears, knowing that these keys are much less common in OSM. Alternatively, we could ask them to special-case OHM somehow or provide a more extensible customization hook, such as an advanced preference that accepts name template syntax.

Activity

  1. added theissue type on Mar 27, 2025
  2. 1ec5 commented on Mar 27, 2025

    @1ec5
    MemberAuthor

    I opened this issue here to start with so we can investigate whether a plugin is even feasible. Otherwise, we’ll need to track the feature enhancement upstream in the JOSM issue tracker.

  3. moved this to Todo-Unknown path in OpenHistoricalMap Dev Planningon Mar 27, 2025
  4. 1ec5 commented on Mar 28, 2026

    @1ec5
    MemberAuthor

    @danvk seems to have solved the list views with a custom preset, and we have documented instructions for solving the map view using the QuickLabel plugin. Some assembly is still required, but we’re in pretty good shape now. #556 tracks publishing a preset pack that’s more discoverable through the JOSM plugin manager.

  5. moved this from Todo-Unknown path to In Production in OpenHistoricalMap Dev Planningon Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions