Modify

Opened 2 years ago

Closed 15 months ago

Last modified 14 months ago

#11975 closed enhancement (fixed)

[Patch] Support Extended Overpass Turbo Queries

Reported by: naoliv Owned by: simon04
Priority: normal Milestone: 16.10
Component: Core Version:
Keywords: overpass turbo geocodeArea Cc:

Description

Building this query aeroway=* in "são paulo, brazil" we have:

[timeout:25];
// fetch area “são paulo, brazil” to search in
{{geocodeArea:são paulo, brazil}}->.searchArea;
// gather results
(
  // query part for: “aeroway=*”
  node["aeroway"](area.searchArea);
  way["aeroway"](area.searchArea);
  relation["aeroway"](area.searchArea);
);
// print results
out meta;
>;
out meta;

Note that we are using a geocodeArea area here.
But JOSM still uses a bbox when querying the API server:

INFO: GET http://overpass-api.de/api/interpreter?data=%5Bbbox%5D%5Btimeout%3A25%5D%3B%0A%2F%2F+fetch+area+%E2%80%9Cs%C3%A3o+paulo%2C+brazil%E2%80%9D+to+search+in%0A%7B%7BgeocodeArea%3As%C3%A3o+paulo%2C+brazil%7D%7D-%3E.searchArea%3B%0A%2F%2F+gather+results%0A%28%0A++%2F%2F+query+part+for%3A+%E2%80%9Caeroway%3D*%E2%80%9D%0A++node%5B%22aeroway%22%5D%28area.searchArea%29%3B%0A++way%5B%22aeroway%22%5D%28area.searchArea%29%3B%0A++relation%5B%22aeroway%22%5D%28area.searchArea%29%3B%0A%29%3B%0A%2F%2F+print+results%0Aout+meta%3B%0A%3E%3B%0Aout+meta%3B&bbox=-50.4103322,-22.6399923,-50.4057894,-22.6367102
ERRO: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400
org.openstreetmap.josm.io.OsmApiException: ResponseCode=400
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:194)
	at org.openstreetmap.josm.io.OverpassDownloadReader.getInputStreamRaw(OverpassDownloadReader.java:92)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:104)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:68)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:51)
	at org.openstreetmap.josm.io.BoundingBoxDownloader.parseOsm(BoundingBoxDownloader.java:166)
	at org.openstreetmap.josm.io.OverpassDownloadReader.parseOsm(OverpassDownloadReader.java:132)
	at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.parseDataSet(DownloadOsmTask.java:306)
	at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.realRun(DownloadOsmTask.java:314)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:161)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

JOSM:

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-10-15 01:32:10
Last Changed Author: Don-vip
Revision: 8882
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-10-15 01:02:36 +0200 (Thu, 15 Oct 2015)
Last Changed Rev: 8882

Identification: JOSM/1.5 (8882 pt_BR) Linux Debian GNU/Linux testing (stretch)
Memory Usage: 439 MB / 9102 MB (120 MB allocated, but free)
Java version: 1.7.0_85, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u85-2.6.1-3
VM arguments: [-Dawt.useSystemAAFontSettings=on]

Attachments (2)

Change History (17)

comment:1 Changed 2 years ago by simon04

geocodeArea is no Overpass construct, but an Overpass turbo construct, which performs a Nominatim search to obtain the bounds.

comment:2 Changed 2 years ago by Don-vip

Keywords: overpass turbo geocodeArea added

comment:3 Changed 2 years ago by tyr_asd

Here's the documentation of the extended query syntax used by overpass turbo.

comment:4 Changed 2 years ago by Don-vip

Summary: Should not use bbox when using geocodeArea in overpassSupport Extended Overpass Turbo Queries
Type: defectenhancement

comment:5 Changed 17 months ago by simon04

Ticket #12939 has been marked as a duplicate of this ticket.

comment:6 Changed 17 months ago by simon04

Milestone: 16.08

comment:7 Changed 16 months ago by simon04

Owner: changed from team to simon04
Status: newassigned
Summary: Support Extended Overpass Turbo Queries[Patch] Support Extended Overpass Turbo Queries

With all the dependencies, integrating expand.js seems more complicated than evaluating geocodeArea in Java. With the patches attached, only geocodeArea is evaluated.

comment:8 Changed 16 months ago by Don-vip

patch can be applied :)

comment:9 Changed 16 months ago by Don-vip

I'd like to see it merged in the incoming next release, is there a specific reason why this patch has not been applied yet?

comment:10 Changed 16 months ago by Don-vip

Milestone: 16.0816.09

comment:11 Changed 16 months ago by simon04

I wanted to rewrite attachment:0002-Evaluate-extended-Overpass-querty-geocodeArea.patch​ to do the Nominatim search when executing the download (and not invoking the wizard). This would do all IO stuff in the same process and allow copying queries from overpass-turbo.eu to the download dialog.
I haven't yet found the time to do this, though.

comment:12 Changed 15 months ago by naoliv

Ticket #13638 has been marked as a duplicate of this ticket.

comment:13 Changed 15 months ago by simon04

In 11002/josm:

see #11975 - Extract NameFinder for Nominatim queries

comment:14 Changed 15 months ago by simon04

Resolution: fixed
Status: assignedclosed

In 11003/josm:

fix #11975 - Evaluate extended Overpass queries bbox, geocodeArea

comment:15 Changed 14 months ago by simon04

Milestone: 16.0916.10

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.