OpenHistoricalMap/JOSM

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

JOSM 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. OAuth 2.0 is the recommended authentication method:

  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,[1] then click Validate.
  4. Select the Use OAuth 2.0 option, then under Access Token Secret, click Authorize now (Fully automatic).
  5. An Authorization Required page should have opened in your default Web browser, asking you to grant JOSM several permissions. Click Authorize.
  6. You should be taken to a page that says simply "OK". Return to JOSM and click OK.

Basic authentication

HTTP basic authentication remains available as an alternative authentication method. Choose Use Basic Authentication and set the OSM username and OSM password to your OHM credentials. These credentials will be transmitted as plain text over the network, so be careful only to use this option on a secure network.

JOSM OHM Preferences.png

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

Notes and references

  1. https://api.openhistoricalmap.org/api is also supported for consistency with the default OSM connection settings. [1]