Using Josm's validator to check boundary relations
Posted by SomeoneElse on 21 March 2025 in English.Lots of people use editors such as iD, Potlatch, Vespucci, GoMap!! etc. for editing. There are entirely sensible reasons for this - I’ll always try and edit relations in Potlatch or iD since for me editing relations there is a much saner experience than in Josm. However, one thing that they miss is Josm’s Validator, which can check for relation errors that other editors can’t. Here’s how to use that to detect problems, and then fix them elsewhere.
I’ve created some test data on the dev server for this, so that I can deliberately create and fix errors. If you want to test with that data on the “dev” server, you’ll need to create an account there and tell Josm to login to that server - or you can just look at the screenshots below.
First, you’ll need to download Josm (I just downloaded the latest .jar file) . Josm’s user interface will be familiar to anyone who used CAD software in the 1980s, but may be less so to others.
Then you’ll need to download some data in the area that you were editing (file / download data / download). So that you can see what is where, it helps to have a background layer - “OpenStreetMap Carto (standard)” will work, or you can use an imagery layer if you prefer. Zoom in to your area of interest, select with the mouse and “download”.
Then click “validate” (on the row at the very bottom right of the screen).
Click on the “+” sign, and then on the second plus sign that has appeared, and then right-click on the actual error and “zoom to problem”. Josm highlights that the relation has two members that corss over each other, in a figure of 8. In OSM that looks like this:
What we need to do is to move the place where the relation is attached to the canal a bit north so that all three relations are valid. It’s a simple fix, so you can do that in any editor that you are comfortable with. I’ll do it in iD
Finally, we need to use Josm’s validator to make sure that nothing else is now an error. It’s the same process as before (File / download data / download, and then “validate”). Now we just have warnings:
The “crossing boundaries” warning (note that it is now not an error) is saying that an area of this relation and this relation now overlap. It’s correct, but fix that properly we’d want to edit the data so that no relations used the bridge at all, which is out of scope of what I’m trying to write here.
The reason why I used an example in Ireland is that Ireland has lots of relations (such as townlands) defined in terms of other features, such as roads and rivers, and except where there is a ford, in OSM roads and rivers shouldn’t join, because one is on a layer above the other. The historical administrators in Ireland didn’t anticipate this, and defined lots of boundaries as “follow this road to this river, then go up that”. The database that I create raster maps from has these relations in it, and I’ve set it up to be notified when any of them “disappear” as valid (multi)polygons.
Discussion
Comment from TheSwavu on 25 March 2025 at 03:46
Another tip is that Osmose has a broken boundary check, so you can set up a RSS feed to find out when they break. It’s a lot easier if there hasn’t been too much editing in the mean time.
I have tried to fix some of the Irish ones in the past, but they require a lot of obscure local knowledge that I don’t have.