JOSM/Plugins/AdaptiveSimplifier
Jump to navigation
Jump to search
Description
This plugin implements an adaptive geometry simplification algorithm for selected ways in JOSM. It efficiently removes redundant nodes based on local curvature and node importance while preserving curve shapes, prevents self-intersections, and protects junction nodes, tagged nodes, and nodes belonging to relations. It also supports merging nearby nodes and prioritizing original author nodes to preserve OSM history.
Usage
- Select one or more ways (by clicking or by selection box)
- Choose Mytools → Adaptive Simplifier from the menu or press the keyboard shortcut (default: Ctrl+⇧ Shift+Y).
- Note: If the default shortcut is already in use, JOSM will assign a different one. You can see the current key combination in the Mytools menu next to the plugin name.
- Configure the parameters:
- Threshold (meters): — the main geometric deviation threshold (0.01–100.0 m). Lower values retain fine details, while higher values remove nodes more aggressively along gentle curves.
- Merge nearby nodes — enables merging/removal of nodes located too close to each other.
- Merge threshold (meters): — minimum distance threshold between adjacent nodes (enabled when the merge option is checked).
- Priority to preserve author nodes — prioritizes retaining existing OSM server nodes with history during node reduction and replacement.
- Click OK
- Upon completion, a summary notification will show the number of simplified ways and removed nodes.
Data Protection Features
- Self-intersection prevention: the algorithm checks the trajectory of each newly formed shortcut segment and cancels node removal if it would cause the way to cross itself or form loops.
- Topology protection: junction nodes (shared by multiple ways), tagged nodes, and nodes participating in OSM relations (routes, turn restrictions, etc.) are strictly protected from deletion.
Installation
- Download the JAR file from the Releases section on GitHub
- Copy it to the JOSM plugins folder:
- Windows:
%APPDATA%\JOSM\plugins\ - Linux:
~/.local/share/JOSM/plugins/or~/.josm/plugins/ - macOS:
~/Library/JOSM/plugins/
- Windows:
- Restart JOSM (the plugin supports loading at runtime as well)
Source code
License
GNU General Public License v3.0