NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

3
2

I want to see a particular feature mapped by a given user, and the opposite (mapped by other users different to a given one). However, I see that the user value is in the Meta section, and I cannot write a query to filter by this criterion.

This is the original query, to get all monitoring stations in Colombia:

[out:xml][timeout:25];
area[name="Colombia"][admin_level=2][boundary=administrative]->.searchColombia;
(
  nwr["man_made"="monitoring_station"](area.searchColombia);
);
out meta;
>;
out meta qt;

However, I know that the user dcruizr has worked a lot on this, and I do not want to see her contributions. I was thinking about something like:

[out:xml][timeout:25];
area[name="Colombia"][admin_level=2][boundary=administrative]->.searchColombia;
(
  nwr["man_made"="monitoring_station"][user!="dcruizr"](area.searchColombia);
);
out meta;
>;
out meta qt;

However, this does not do any filter on the data. How can I write a query to filter by user?

asked 22 Jan '22, 19:51

AngocA's gravatar image

AngocA
281232433
accept rate: 0%


As an update to DaveF's answer, you now can negatively filter for users:

area[name=Colombia][admin_level=2];
nwr[man_made=monitoring_station](area)(if:user()!="dcruizr");
out meta;
>;
out meta qt;

The if conditional allows for free-form boolean operations. The only restriction is that it only works in combination with another conditional, because one otherwise could too easily ask accidentally for the whole planet.

permanent link

answered 22 Jan '22, 21:23

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

It's irritating we can't negate user's input directly in overpass.

The Data variable is used so the search for the user is only performed on the monitoring_stations returned & not the whole of Columbia, speeding it up slightly.

Note user uses a colon, not an equals sign.

https://overpass-turbo.eu/s/1fjq

area[name=Colombia][admin_level=2];
(
 nwr[man_made=monitoring_station](area)->.Data;
 -nwr.Data(user:dcruizr);
);
out meta;
>;
out meta qt;
permanent link

answered 22 Jan '22, 20:45

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 22 Jan '22, 20:45

1

Thank you for your answer. I'm just adding an extra answer, because there are more semantics available now.

(22 Jan '22, 21:15) Roland Olbricht

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×228
×147
×66
×57

question asked: 22 Jan '22, 19:51

question was seen: 3,030 times

last updated: 22 Jan '22, 21:23

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum