↖ Fixing Polygons in OSM

Fixing old-style multipolygons with JOSM

Fixing old-style multipolygons isn't very difficult with JOSM. Here is a step-by-step description on what to do.

1. Find a suitable area to work on

First you need an area to work on. You can look at the comparison map, pick out an area with lots of old-style multipolygons and load it into JOSM using the "JOSM" button on the top right. (You have to start JOSM before this and have remote control enabled.)

2. Fix the multipolygons


Old-style multipolygons will show up in the relations list without a type (like the first three in the image above). New-style multipolygons will (most of the time) show up with the type in parentheses, like the highlighted one in the image.

Choose a multipolygon in the "Relations" list and select it (Choose "Select relation" in the context menu). Zoom to the selection (in the "Selection" list, choose "Zoom to selection" in the context menu). Download the area shown. You now have the full relation with current data and all its context in JOSM.

Now look at the relation and its members and fix it.

Often you can use JOSM's built-in function "Update multipolygon" (Ctrl+Shift+B) in the "Tools" menu. This will move tags from the outer way to the relation. But it will not work with old-style multipolygons with multiple outer ways. Select the multipolygon and one of its ways first to use this.

If the multipolygon only has a single outer way, you might want to simply leave the tags on the way and delete the multipolygon relation.

After you have fixed the multipolygon, move on to the next one. If you are in an area with lots of multipolygons, chances are each time you load the context of one, more old-style multipolygons will be loaded, too. This way you can move quickly through an area.

3. Uploading the changes

When you are uploading the changes, please use a changeset comment that contains the words "old-style multipolygon". That way we can track this work better.

Tip: Using Overpass to load old-style multipolygons into JOSM


"Download from Overpass API" dialog in JOSM.

You can also start by using an Overpass queries to find (most) old-style multipolygons. In JOSM go to the "File" menu and choose "Download from Overpass API", enter the following query which finds all multipolygon relations without tags and choose an area.

relation({{bbox}})
  [type=multipolygon]
  (if:count_tags()==1);
(._;>;);
out meta;

Or you can use this somewhat more complete query which also finds relations with some more tags:

(
  relation["type"="multipolygon"]({{bbox}}) (if:count_tags()==1);
  relation["type"="multipolygon"]["created_by"]({{bbox}}) (if:count_tags()==2);
  relation["type"="multipolygon"]["source"]({{bbox}}) (if:count_tags()==2);
  relation["type"="multipolygon"]["note"]({{bbox}}) (if:count_tags()==2);
);
(._;>;);
out meta;

Tip: Using Filters in JOSM

A JOSM filter containing

type:relation type=multipolygon tags:1

will match all multipolygon relations with only the single tag type=multipolygon, which is most of the old-style multipolygons.

Activate the "Enable filter" and "Invers filter" checkboxes to hide everything but those multipolygons.

Tip: Adding overlay from comparison map to JOSM

The comparison map has an overlay showing all old-style multipolygons. You can easily add this overlay to JOSM:

Go to the "Imagery" menu and choose "Imagery preferences". Next to the "Selected entries" list, click on the button labelled "+ TMS". Enter

http://area.jochentopf.com/old_mp_ways_overlay/{zoom}/{x}/{y}.png

in the URL field. Set the max zoom level to 18 and enter a name such as "Old-style multipolygons". Click OK twice to close the dialogs. You should now have another entry in "Imagery" menu that activates the layer.

The layer is transparent so you can use it over one of the satellite image layers.

Caution!

Do not just blindly update everything! Look at the tags on the relation and on all member ways, look at multipolygons around it, look at the satellite images, check that the roles are set correctly and use the validator. Especially with very old data, there is often a chance to update some tags, too. Or there might be geometrical problems, or the data might be from an old import and is just outdated. As always with editing OSM data: Take care to do the right thing and use your judgement.

Do you have any other tips for this page? Or a different way of editing the data? Don't like the description here? Open an issue and tell us about it.