Overpass-API icon indicating copy to clipboard operation
Overpass-API copied to clipboard

count_distinct_members() doesn't work as documented

Open nmxcgeo opened this issue 6 years ago • 3 comments

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

nmxcgeo avatar Jan 29 '19 21:01 nmxcgeo

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.

mmd-osm avatar Jan 29 '19 21:01 mmd-osm

Task: Review the wiki for changes in the documentation that do not correspond to changes in the code.

drolbr avatar Mar 21 '19 17:03 drolbr

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.

nmxcgeo avatar Jun 08 '19 07:06 nmxcgeo