Overpass-API
Overpass-API copied to clipboard
count_distinct_members() doesn't work as documented
Hello,
I've created the following Query to test the behaviour of count_distinct_members(): https://overpass-turbo.eu/s/FDo
relation(if: count_distinct_members() == 3)({{bbox}});
(._; >;);
out body;
It returns multiple relations including https://osm.org/relation/7374791 and others, which shouldn't be returned according to documentation:
For a relation, count_distinct_members() returns the number of unique members of the relation. If a member object is repeated in a relation, regardless of if the roles are different, the object will not be counted twice.
Some of the returned relations contain the same "from" and "to" way and thus should have two distinct members.
Did I misunderstand the documentation or is Overpass-turbo or Overpass API misbehaving?
Thanks for looking into this. Nmxcgeo
Also filed in https://github.com/tyrasd/overpass-turbo/issues/415
Thanks for bringing this to our attention. It seems that someone unrelated to the project changed the documentation in the wiki and introduced the section you’re quoting. It’s not been part of the original documentation. We’ll have to review this part of the wiki and possibly undo other incorrect changes as well.
Task: Review the wiki for changes in the documentation that do not correspond to changes in the code.
Is there any progress on this? I think that wrong docs are even more confusing than no docs. You could at least mark the wrong sections until you rewrite them.