fixing-polygons-in-osm
fixing-polygons-in-osm copied to clipboard
handle emtpy role as deprecated, too
Maybe the Wrong role case should also include empty roles which are deprecated according to the wiki (since at least mid 2011):
[role=empty:] Don't use, deprecated. Tools may handle this as outer.
There are currently so many empty roles that I didn't want to clog that category with those cases. Yes, they are wrong, but "not as wrong" as the other cases, so I see a lower priority for them.
so many empty roles
Do you know the order of magnitude of such cases (or affected % of total MPs)? In my limited personal experience, I have actually only relatively rarely seen such cases in comparison to old-style MPs (and for me, most often I saw inner ways with missing roles, like this example – which actually is a somewhat more severe error).
PS: here's a simple overpass query to find multipolygons with empty role members for manual fixing:
http://overpass-turbo.eu/s/nNK
@tyrasd
.... so many empty roles Do you know the order of magnitude of such cases (or affected % of total MPs)?
As I see here https://taginfo.openstreetmap.org/relations showing the ["empy role"] percent and it is easy to check the exact numbers for the affected relation types, just point with a mouse to "empty role"
- type=route + "empty role" =75.76%
- table: https://taginfo.openstreetmap.org/relations/route#roles
- graph: https://taginfo.openstreetmap.org/relations/route#graph
- type=site + "empty role" = 94.95%
- https://taginfo.openstreetmap.org/relations/site#roles
- type=public_transport + "empty role" = 26.52%
- https://taginfo.openstreetmap.org/relations/public_transport#roles
- ....
sorry .. the affected % of total MPs :
- https://taginfo.openstreetmap.org/relations/multipolygon#roles = 0.42%
Thx, totally didn't think about just looking it up on taginfo. :laughing:
So, in absolute numbers it's about 6 times more empty role members than members where the role is anything other than "outer", "inner", or empty.
So, in absolute numbers it's about 6 times more empty role members than members where the role is anything other than "outer", "inner", or empty.
yes, many Long tail - errors :)
As I see 330 unique role types [ 330 items
] and maybe only ~5 is valid
and there are some interesting combinations:
-
role=outer
+ member nodes = 160 -
role=inner
+ member nodes = 157 -
role=""
(empty) + member nodes = 1255 ( interpreted as anrole=outer
)
Side note: according the wiki:
- "Mainly in Germany type=multipolygon has also been used instead of type=boundary for boundary relations. "
So the type=boundary roles should be accepted as a valid type=multipolygon
roles:
-
outer
,inner
,subarea
,admin_centre
,label
maybe this is not as important ( related to osm2pgsql change), but good cases for OSM Changeset Analyzers , osm-compare rules for detecting similar error types as early as possible.
So the type=boundary roles should be accepted as a valid type=multipolygon roles
I think we should probably re-tag those as type=boundary.
I think we should probably re-tag those as type=boundary.
JOSM does this automatically for some years now. Hopefully not many left...
Regarding this ticket - Did you check if the number of multipolygons with empty roles as outer differs a lot from these where roles are wrong or inner is empty? I very seldom find empty roles, but I found a large number of polygons in east Europe, which have all empty roles. Maybe fixing these will reduce the number of empty outers as well?
Anyway showing the number of affected multipolygons instead of the number of affected roles would anyway be better :-)
I fixed a lot of these in central Europe using the overpass query above and in most cases missing outer role also indicates other issues. So I agree, that role blank should be handled as error similar to any other role not outer/inner in the tests and statistics.
Most often cases:
- no roles at all
- useless multipolygon relations (grouping objects or single member)
- wrong objects (houses, streets, ...) in relation
- role=inner, role=outer as tags for the ways