From OpenStreetMap Wiki
< JOSM‎ | Plugins
Jump to navigation Jump to search

Why using the ContourOverlappingMerge plugin?


That plugin action determined overlapping from two contours (e.g.: forest and waterway), erase overlapping zone and merge the two contours from the priority contour border.

Plugin action

  1. Determine which contour have priority
  2. Calculate and draw overlapping intersection points
  3. Redraw the border from non-priority contour to the priority contour border, in the overlapping section

Special cases

An special case is then contours have more than one overlapped section (exists more than two intersection points). In these case plugin action must redraw the non-priority contour border to the priority contour border in overlapped section (between even and odd intersection points). In overlapped section the priority contour border is redrawn to the non-priority contour border (between odd and even intersection points).


The plugin should be available in your JOSM Plugins preference window under "ContourOverlappingMerge" or you can download it from [1]. (Fix for current JOSM [2])


  1. Select two contours with Ctrl+Click or Shift+Click on the contours.
    Attention: the first selected contour (red below) has the priority, the second selected contour border (gray below) will merge on the first selected contour border
  2. Then press the button Button.png on the Tools menu or press Zero Key.
    The overlapping section is removed from the second contour and the the second selected contour has its border adjusted to follow the first selected contour along the previous intersection zone. Both contours are modified to create the intersection nodes if needed and insert them correctly in their defined sequences of nodes.

Other example

When have a special case, when the contours have more than one overlapping section (below, the leftmost contour is the first selected one). The hole(s) left between the two previously overlapping contours are assigned to the first contour that will then cover a larger area. This may not be expected, notably when these holes covered a large area, for example when merging a farmland area and a forest area around some residential or farmyard areas, with the modified farmland or forest now covering these residential/farmyard areas, whose borders are no longer visible completely because nodes where deleted:

ContoursOverlapp3.png ContoursOverlapp4.png

Ideally the plugin should have an option to keep these holes intact (ouside the two merged polygons) by keeping all their nodes and creating additional polygons around them, so that users can selectively select which hole polygons to merge (or not) into one of the two initial contours, and then assign relevant tags to the new untagged polygons not merged.