OpenHistoricalMap/JOSM

From OpenStreetMap Wiki
Jump to navigation Jump to search
Main article: OpenHistoricalMap/Contributing

JOSM[1] is a more advanced alternative to iD, especially useful for large-scale tasks like imports and mapping international boundaries. OpenHistoricalMap uses the same official distribution of JOSM that OSM contributors use. Before you can contribute to OHM using JOSM, you need to adjust several configuration settings away from the OSM defaults.

Basic setup

Main article: JOSM/Installation
Main article: JOSM/Guide

Configuring server settings

Before you can edit OpenHistoricalMap instead of OpenStreetMap, you need to change the connection settings.

information sign

As of January 2025, OAuth 2.0 is the only supported authentication method. Basic Authentication is no longer supported.
  1. Open the Preferences window and switch to the OSM Server tab.
  2. Uncheck Use the default OSM server URL.
  3. Set OSM Server URL to https://www.openhistoricalmap.org/api (no trailing slash).[2]
  4. Click Validate.
  5. Select the Use OAuth 2.0 option,
  6. Under Access Token Secret, click Authorize now (Fully automatic).
    OHM JOSM prefs setup.png
  7. If you have not already logged in to OHM, you'll be asked to do so.
    JOSM OHM OAuth2 login.png
  8. An Authorization Required page should have opened in your default Web browser, asking you to grant JOSM several permissions. Click Authorize.
    Josm ohm oauth auth.png
  9. If you have not already set up any OAuth2 apps in JOSM, you may be asked to allow remote control to set credentials in JOSM. Click Yes, once.
    Josm oauth setup remote control.png
  10. You should be taken to a page that says simply "OK". Return to JOSM and click OK.

Overpass

The Overpass API enables you to work with large features or large amounts of features by downloading a sparse subset of data instead of the full data:

  1. Open the Preferences window and switch to the OSM Server tab.
  2. Check the Expert Mode checkbox at the bottom of the window.
  3. Set Overpass server to https://overpass-api.openhistoricalmap.org/api/, then click OK.
  4. Go to File and select Download data. Switch to the Download from Overpass API tab.

Remote control

The Remote Control feature allows you to quickly access JOSM and access relevant data while browsing the main OSM website:

  1. In JOSM, open the Preferences window and switch to the Remote Control tab. Make sure Enable remote control is enabled.
  2. On openhistoricalmap.org, click the dropdown menu next to the Edit button and choose Edit with Remote Control.

You may need to configure your operating system's built-in firewall to allow JOSM to listen to localhost port 8111. The procedure varies from system to system.

utilsplugin2

You can configure shortcuts to open the OHM website from within JOSM. In the "Utilsplugin2 settings" tab of the Preferences window, add the following custom URLs.

View Element History on OpenHistoricalMap
https://www.openhistoricalmap.org/{#type}/{#id}/history
Browse Element on OpenHistoricalMap
https://www.openhistoricalmap.org/{#type}/{#id}

Alternatively, you can add the following lines to the plugins/utilsplugin2/customurl.txt file in your JOSM preferences folder:

View Element History on OpenHistoricalMap [demo, =Ctrl-Shift-H]
https://www.openhistoricalmap.org/{#type}/{#id}/history
Browse Element on OpenHistoricalMap [demo, =Ctrl-Shift-I]
https://www.openhistoricalmap.org/{#type}/{#id}

By default, these custom URLs are only accessible from the DataSelect custom URL menu item. However, you can make these URLs accessible via the ViewHistory (web) and DataOpen custom URL items and their associated keyboard shortcuts by appending special suffixes to their names, as seen above.

Date filter

The ohm-date-filter plugin allows you to interactively filter the map features to a specific time period, reducing clutter from time periods that you aren't actively editing. To install this plugin, go to the Plugins tab of the Preferences window, then search for ohm and check the checkbox next to ohm-date-filter.

Other preferences

When a feature evolves over time, OHM maintains multiple copies of the feature that differ by start_date=* and end_date=* tags. But since the type=* and name=* tags generally remain identical, the Relations panel often ends up listing many identically labeled relations. To more easily disambiguate the relations, you can open Advanced Preferences and modify mappaint.nameOrder and relation.nameOrder to include start_date and end_date, then restart JOSM.

Using an alternate preferences file

You can set up an alternate JOSM preferences.xml file and run JOSM from the command line if you wish to avoid changing the server preferences repeatedly.

Mac and Linux

By default JOSM puts its preferences file in a subdirectory, .josm. You can clone this directory and run JOSM from the command line. For example, copy .josm to .josm-ohm; edit the preferences.xml file and review & possibly change the settings for osm-server.auth-method, osm-server.password, osm-server.username, and osm-server.url. Once this is done, you can set up an alias in your shell profile such as:

josm-ohm='java -Djosm.home=/Users/myhomedir/.josm-ohm -jar /Users/myhomedir/JavaApps/josm-tested.jar

Windows

Red x.svg To do: need Windows details

Known issues

Other than the basic settings above, JOSM has not been optimized for OHM:

Notes and references

  1. Officially an acronym of "Java OpenStreetMap Editor", but you may also think of it as "Java OpenHistoricalMap Editor".
  2. https://api.openhistoricalmap.org/api is also supported for consistency with the default OSM connection settings. [1]