fixing-polygons-in-osm
fixing-polygons-in-osm copied to clipboard
Fix complex rings?
Some mappers find it easier in their editor or intellectually challenging to map touching areas by forming multipolygons with rings split in many pieces.
While mapping with polygon origami isn't an error, these complex MPs are difficult to maintain, which tends to cause errors. The DWG has asked mappers who were doing this on a large scale to stop doing this, and rebuilt some of those polygons.
Could detecting and fixing this kind of polygons be part of this project?
This just looks like over-detailed mapping to me. Can you give a rule (that can be automated) that would describe (at least some of) those cases?
It doesn't actually add any detail - if you look at https://www.openstreetmap.org/relation/3177299, this could be one outer and one inner way forming the rings without removing any information.
Having more than one way in a ring isn't necessarily an error - it can be legitimate to cut rings with many nodes, like https://www.openstreetmap.org/relation/1066719
The overpass query I linked above finds only some of the worst examples. An automatable rule would maybe be multipolygons, with rings that contain more than one way, with less than 500 nodes per way in at least two of the ways in that ring?
Both relations you mention look reasonable to me. In fact I would argue that splitting them up more could make sense. (Less to download if only working on a part of the multipolygon and re-use of the ways on neighboring mps for instance.) But different people have different ideas here. I don't see how we can fit this into a general rule except that the real extremes (lots of ways with only two nodes in an mp relation or ways all with 2000 nodes) are probably bad.
But even if we decide those extreme cases are not optimal, does it really help to fix them in a large effort? Can't they be fixed whenever a mapper encounters them?
You and I can fix them whenever we encounter them, but these origami polygons intimidate newbies and, in my experience, lead to the kind of errors you've started this project for. Fixing those in a large effort, or at least detecting them, is preventative: many of the very complex MPs I fixed around here had self-intersections or unclosed rings.
If you look at the changeset comments on https://www.openstreetmap.org/relation/3177299's ways, it's clear that they are confusing some mappers: "MPs entwirrt", etc.
I think the typical "origami" polygons that we encountered e.g. in Luxembourg had two noticeable properties:
-
A very high number of ways compared to the total area of the polygon. I think if we computed the number-of-ways : area relation for all multipolygons in OSM (or all where the outer ring is more than 1 way, to exclude the building-with-hole case), then the problematic polygons would likely all be in the top 5%.
-
Polygons with multiple, closed, outer rings but without any identifying tag on them (i.e. no "name", "ref" or so), so you'd have someone mapping three neigbouring landuse=grass areas as one multipolygon with three outer rings, even though there was nothing they had in common except all being grass.