As of this morning, the website automatically appends a date range to each element label based on start_date=*
and end_date=*
. Dates also appear automatically in Nominatim search results and Overpass query results. You no longer need to hard-code dates inside name=*
in order to keep similarly named features straight in your head.
The wiki now has instructions for automatically appending the start date to each object’s label in JOSM’s map view .
The one place where automatic date labels are missing is JOSM’s sidebar:
opened 06:48PM - 27 Mar 25 UTC
dates
JOSM
help wanted
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.
<img width="619" alt="JOSM’s Selection, Relations, and Validation Results sidebar panels listing multiple relations as Central Time Zone." src="https://github.com/user-attachments/assets/0da74f1f-92d8-4a8d-bc73-1beca37418b6" />
## 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`](https://wiki.openstreetmap.org/wiki/Special:PermanentLink/2822156#Other_preferences), but unfortunately this is just a list of key names, not the full [name template syntax](https://josm.openstreetmap.de/wiki/TaggingPresets#name_templatedetails). 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](https://github.com/JOSM/josm/blob/b3f96cf9fa6ceddffae3c82aac98787d8095f128/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java#L594-L630) and [relations](https://github.com/JOSM/josm/blob/b3f96cf9fa6ceddffae3c82aac98787d8095f128/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java#L632-L667) 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.
Even so, I think it’s time to start removing date ranges from names, since they now result in confusing clutter everywhere other than JOSM. According to this Overpass query , 22,355 elements contain possible date ranges. A mass find-and-replace operation in JOSM could dramatically reduce this number, but we’ll have to be careful about names that legitimately end with numbers, especially commemorative plaques and the like.