You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
Pages: 1
#1 2020-05-29 08:08:38
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Bot to remove empty relations?
It seems that some editors make it too easy to create empty relations. Would it be possible to remove them automatically with a bot?
The criteria would be this:
No members and version<=2 and either no tags or just a type=* tag
Maybe an additional filter regarding last modified timestamp being older than 10 days.
I have no idea how to code or execute a bot but I read that they exist.
thanks,
Gerd
Offline
#2 2020-05-29 18:20:43
- Bernhard Hiller
- Member

- Registered: 2011-05-10
- Posts: 1,122
Re: Bot to remove empty relations?
Why do you want to use those additional criteria instead of a "remove all empty relations"? In my opinion, a relation without members is useless.
By the way, is it possible to make an empty relation by removing all members from an existing relation, e.g. in Josm? Then moving members manually from one relation into an other relation could lead to such empty relations, with quite version numbers too.
Offline
#3 2020-05-29 19:27:50
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Re: Bot to remove empty relations?
Why do you want to use those additional criteria instead of a "remove all empty relations"? In my opinion, a relation without members is useless.
By the way, is it possible to make an empty relation by removing all members from an existing relation, e.g. in Josm? Then moving members manually from one relation into an other relation could lead to such empty relations, with quite version numbers too.
Some empty relations were normal relations with maybe hundreth of members before the last edit. Mappers cannot only create empty relations by mistake, they can also remove all members of new or old relations.
I don't care which editor was used to do this, probably each editor allows to do it.
Offline
#4 2020-05-29 21:49:38
- SimonPoole
- Member
- Registered: 2010-03-14
- Posts: 2,195
Re: Bot to remove empty relations?
There are a number of good reasons why empty relations shouldn't be deleted automatically, see the last dozen or so discussions on the matter.
Not to mention that they do not actually have any negative impact outside of irritating people with an overly high tidiness itch (some would argue that is a good thing).
Offline
#5 2020-05-29 22:00:24
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Re: Bot to remove empty relations?
Could not find any discussion about this. Do you have a link for me?
Offline
#6 2020-05-29 22:51:17
- SimonPoole
- Member
- Registered: 2010-03-14
- Posts: 2,195
Re: Bot to remove empty relations?
Could not find any discussion about this. Do you have a link for me?
I'm just going to give you the gist:
- it might just be a temporary situation (as empty relations have no impact, there is no reason not to have a temporarily empty a relation for example while you are redoing a route or whatever).
- if the members were deleted in error it is contra-productive to delete the relation.
Offline
#7 2020-05-30 07:12:21
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Re: Bot to remove empty relations?
Well, you list those cases which my suggested filters should catch. I agree that we don't want to remove relations which where accidentially emptied.
Empty relations have in fact at least two impacts:
- they change numbers in Taginfo
- they appear in global overpass searches like "all type=waterway relations" unless you filter them
I did such an overpass query to find a parent/child dependency loop and just wondered why the useless data is not removed by a bot.
In the end I found out that I can suppress them with a clause like (if:count_members() > 0)
Offline
#8 2020-05-30 07:31:32
- Mateusz Konieczny
- Member
- Registered: 2013-09-22
- Posts: 2,698
Re: Bot to remove empty relations?
Not to mention that they do not actually have any negative impact outside of irritating people with an overly high tidiness itch (some would argue that is a good thing).
And given basically 0 impact even people with high tidiness itch, capable of making and running bots (for example me) prefer to spends time on reviewing other kinds of data, where edit will have some impact.
And, as mentioned, here in basically all cases manual review will be necessary anyway - so you can just do this in JOSM.
Offline
#9 2020-05-30 07:37:02
- SimonPoole
- Member
- Registered: 2010-03-14
- Posts: 2,195
Re: Bot to remove empty relations?
I did such an overpass query to find a parent/child dependency loop and just wondered why the useless data is not removed by a bot.
SimonPoole wrote:GerdP wrote:Could not find any discussion about this. Do you have a link for me?
I'm just going to give you the gist:
- it might just be a temporary situation (as empty relations have no impact, there is no reason not to have a temporarily empty a relation for example while you are redoing a route or whatever).
- if the members were deleted in error it is contra-productive to delete the relation.
PS: if you have the suspicion that there is a large number created by a specific editor, then we should be fixing the issue at the source.
Last edited by SimonPoole (2020-06-02 10:37:06)
Offline
#10 2020-05-30 08:45:44
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Re: Bot to remove empty relations?
I see at least one special pattern regarding JOSM. I found ~18.000 empty relations with version 1.
The vast majority are multipolygons (> 15.000), so I checked a few. I found only JOSM, so I created a new ticket: https://josm.openstreetmap.de/ticket/19316
Offline
#11 2020-05-30 11:36:53
- R0bst3r
- Member
- Registered: 2015-04-23
- Posts: 686
Re: Bot to remove empty relations?
QS-Tools wie z.B. KeepRight finden z.B. Relationen ohne Typ.
Oft Multipolygone, z.B. für einfache Häuserumrandungen.
München scheint ein Schwerpunkt.
OSM Profis sollten Anfänger mehr ermuntern und mehr unterstützen, damit die Gemeinschaft wächst und vielfältiger wird. Momentan vergrault man immer noch gerne.
Offline
#12 2020-05-30 11:43:04
- GerdP
- Member
- Registered: 2015-12-18
- Posts: 1,972
Re: Bot to remove empty relations?
QS-Tools wie z.B. KeepRight finden z.B. Relationen ohne Typ.
Andere Baustelle, aber auch davon gibt es immerhin mehr 17.600 laut overpass.
Offline
#13 2020-06-21 00:50:56
- durests
- Banned
- Registered: 2019-11-10
- Posts: 6
Re: Bot to remove empty relations?
By the way, is it possible to make an empty relation by removing all members from an existing relation, e.g. in Josm? Then moving members manually from one relation into an other relation could lead to such empty relations, with quite version numbers too.
Offline
Pages: 1