drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
690 stars 90 forks source link

Request for Implementation of Negative User Queries in Overpass Api #717

Open baditaflorin opened 3 months ago

baditaflorin commented 3 months ago

Issue: The Overpass turbo wizard currently lacks support for negative user queries, as highlighted in this discussion. This absence impedes users from efficiently filtering data based on user contributions, hindering their ability to extract relevant information from OpenStreetMap (OSM) data.

Proposal: To address this limitation, we propose the implementation of negative user queries within the Overpass Turbo Wizard. This enhancement will allow users to exclude specific contributors from their queries, enabling more precise data extraction tailored to their requirements.

Current Workaround: Currently, users resort to manual query setup using the difference statement, as exemplified below:

[out:json][timeout:25];
{{geocodeArea:Boylston,Massachusetts}}->.searchArea;
(
  way["highway"](area.searchArea); - 
  way(user:"MassGIS Import")["highway"](area.searchArea);
);
out body;
>;
out skel qt;

Proposed Solution: The proposed solution involves integrating negative user queries directly into the Overpass Turbo Wizard interface. Below is an example of how the functionality could be implemented:

[out:json][timeout:25];
(
  node(newer:"2024-03-06T02:05:00Z")({{bbox}})(!user:"baditaflorin");
  way(newer:"2024-03-06T02:05:00Z")({{bbox}})(!user:"baditaflorin");
  relation(newer:"2024-03-06T02:05:00Z")({{bbox}})(!user:"baditaflorin");
);
out body;
>;
out skel qt;

Current Error: When attempting to utilize negative user queries within the Overpass Turbo Wizard, users encounter errors such as:

vbnet Copy code An error occurred during the execution of the overpass query! This is what overpass API returned: Error: line 3: parse error: Unknown query clause

Error: line 4: parse error: Unknown query clause

Error: line 5: parse error: Unknown query clause

Expected Outcome: Upon successful implementation, users will be able to seamlessly incorporate negative user queries into their Overpass Turbo Wizard queries, enhancing their ability to filter OSM data based on user contributions.

Additional Information: This enhancement aligns with the goal of empowering users with efficient tools for data extraction and analysis within the OpenStreetMap ecosystem. I believe that integrating negative user queries into the Overpass Turbo Wizard will greatly benefit the community by streamlining data retrieval processes and fostering more nuanced analyses.

mmd-osm commented 3 months ago

It’s a bit confusing that you keep talking about Overpass Turbo Wizard which has nothing to do with the Overpass API, and is therefore off topic for this repo. Can you please clarify what exactly you’re expecting? Also note that the help page you’ve quoted is outdated. You can use (if:user() != "username") today.

Example:

nwr(newer:"2024-03-06T02:05:00Z")({{bbox}})(if:user() != "baditaflorin");
out meta geom;