A previous diary post-The invalid areas of the map introduced us to invalid relations formed due to multipolygon relation being broken due to various errors. The post has a comprehensive discussions on different errors, its severity and respective simple fixes. It also has these interesting open questions which needs to be debated.
It seems like a huge majority of the issues need to be carefully reviewed by hand and cleaned up. What does a realistic approach to clean the map look like?
The flexibility of the current map editors allows mappers to continue to create features that don’t make sense like a way tagged as a forest. Is it time for stricter validity checks on uploads?
The current diary post walks through the tools which aids in fixing these invalid multi polygon relations which not only remains erroneous part of the map but also affects the map rendering.
Start by reading this documentation on multipolygons if you are trying to understand the basics.
How to identify invalid multipolygons ?
An error debugging tool from Geofabrics - OSM Inspector tool aids in identifying these invalid relations in OpenStreetMap. The tool can be either used in a web browser interface or as a layer in JOSM editor.
To use OSM inspector in a web browser,
- Go to http://tools.geofabrik.de/osmi
Areasfrom ‘View’ menu.
- Left panel contains the list of all possible errors which enables user to toggle between errors.
- The map window highlights the node causing error and allows user to pan, zoom over the map in order to inspect the affected portion of the relation.
- The Selection panel at the right edge of the page displays the selected object and the small icons on the top leads you to map editors where one can fix the issue and also to open OpenStreetMap.
Elements in OSM Inpector tool page
To use it the tool JOSM editor,
Imagery preferencesfrom the menu bar.
OSM Inspector: Areaand activate the layer from the list of available layers or add this as a WMS layer in JOSM
- Now, the layer will be listed under the imagery menu.
- Load the layer and you will have a layer showing all the broken geometries with nodes highlighting at the region of errors and also a text label which mention the error around the node.
Once the error is rectified, make sure to check the roles and sorting order of the relation from the relation window before uploading the data to OpenStreetMap. Along with the tool, JOSM validator can be used to validate the geometry once it has been fixed.
Adding OSM Inspector layer to JOSM
This guide runs through a short tutorial on enabling the OSM Inspector ‘Areas’ layer and its usage in JOSM. Combination of both these validators results for a powerful error debugging tool to identify and fix errors in invalid relations.
Fixes by Mapbox team
The data team at Mapbox reviewed about 1024 invalid multipolygons and fixed around 70% of them with help of OSM inspector. Out of the rest, about 16% of them were unfixable issues. (Ex. Administrative boundaries of
type=boundary and disputed borders; Segment missing in the relation causing
ring not closed issues). 6% of them had a number of minor errors (Ex. Touching rings) which were not serious issues as it did neither harmed other data nor affect rendering of the map. Check out more at the fixing broken multipolygon issue.
There exists a huge number of broken/ invalid relations which needs to be fixed. These invalid areas of the map can only be fixed by the local community mappers. Would love to hear any suggestions or feedbacks and other tools that can be utilised to identify the broken multi polygon relations. Have any questions, leave a comment below.