Klerik7
(Klerik7)
May 15, 2024, 2:44pm
1
I would like to check the key “ref:minvskaddress” using the validator, because it happens that duplicates of this key are created… could anyone help how to create such a mapcss, so that when running the validator it catches this duplication? since a similar principle works for addresses, it could work here too…it would look for a duplicated value of a given key higher up…I can’t find what code is used for duplication of addresses
emvee
(Emvee)
May 16, 2024, 6:47am
2
Welcome, question about josm I guess.
I think this is not done via mapcss as mapcss is acting on a single object so it can not do this compare. The code should be relatively easy to find if you have the exact text of the “address error”
emvee
(Emvee)
May 16, 2024, 6:02pm
4
A grep through the josm sources gives:
josm/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
239: .message(tr("Duplicate house numbers"), marktr("''{0}'' ({1}m)"), simplifiedAddress, (int) distance)
335: .message(tr("Duplicate house numbers"), marktr("House number ''{0}'' duplicated"), entry.getKey())
See Addresses.java in josm/trunk/src/org/openstreetmap/josm/data/validation/tests – JOSM
An alternative is to use Overpass:
opened 03:44PM - 10 Jul 18 UTC
closed 07:15PM - 14 Jul 18 UTC
question
Hi
I want to select all `railway=stations` & return any which have the same nam… e.
I've used [This wiki example](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#Find_relations_with_identical_wikidata_tags_.28since_0.7.54.29) as a starting point.
This is as far as I got:
```
[bbox:{{bbox}}];
nwr[railway=station][name]->.a;
foreach .a -> .b (
nwr.a(if:t["name"] == b.u(t["name"]))->.d;
);
.d out center;
```
It appears to only return the last found duplicates, so I added a line to try & collect them together:
```
[bbox:{{bbox}}];
nwr[railway=station][name]->.a;
foreach .a -> .b (
nwr.a(if:t["name"] == b.u(t["name"]))->.d;
(.d ; .result; ) -> .result;
);
.result out center;
```
But it returns all stations in the bbox.
This [Overpass Example](http://overpass-turbo.eu/s/Acc) would hopefully return New Cross Gate station as well as Greenwich.
----
From the [Union/Set wiki page](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Aggregators) its unclear to me what `u` returns if there are multiple values found.
Klerik7
(Klerik7)
May 16, 2024, 1:54pm
3
yes, the question is about josm…
when the address is duplicated, it prints the text: Duplicate house numbers
this test should be performed by this item