Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11428 closed enhancement (fixed)

Add Overpass download dialog to core, provide Overpass Turbo wizard

Reported by: simon04 Owned by: simon04
Priority: major Milestone: 15.09
Component: Core Version:
Keywords: overpass turbo js javascript Cc: Klumbumbus

Description

This patch adds the Overpass download dialog to core, and in addition provides Overpass Turbo wizard (using Java's script engine) to quickly and intuitively generate an Overpass Query …

Attachments (6)

0001-Add-Overpass-download-dialog-to-core-provide-Overpas.patch (17.6 KB) - added by simon04 4 years ago.
overpass.png (115.6 KB) - added by bastiK 4 years ago.
0001-Add-Overpass-download-dialog-to-core-provide-Overpas.v2.patch (17.7 KB) - added by simon04 4 years ago.
0001-Add-Overpass-download-dialog-to-core-provide-Overpas.v3.patch (61.4 KB) - added by simon04 4 years ago.
2015-08-24-093410_998x581_scrot.png (138.1 KB) - added by simon04 4 years ago.
2015-09-22-194711_1123x122_scrot.png (10.3 KB) - added by simon04 4 years ago.
Example for syntax error reporting

Download all attachments as: .zip

Change History (44)

comment:1 Changed 4 years ago by Klumbumbus

Cc: Klumbumbus added

Changed 4 years ago by bastiK

Attachment: overpass.png added

comment:2 Changed 4 years ago by bastiK

Layout is strange, see attachment.

comment:3 Changed 4 years ago by bastiK

It may backfire if we have too many hardcoded URLs in JOSM-core:

https://overpass-api.de/api/

We already have a meta-list of overpass servers: MirroredDownloadInfo.

https://raw.githubusercontent.com/tyrasd/overpass-turbo/b0ef5ebbdd353c1bc7e45da527cab03498b4cbef/

Maybe mirror this code at a place that we have control over.

comment:4 Changed 4 years ago by simon04

bastiK, thank you for your review.

  • The layout should be fixed (damn GBC.fill() vs. GBC.fill(GBC.HORIZONTAL) (maybe we should provide GBC.fillHorizontal() and deprecate the GBC.fill()?)
  • Hardcoded URLs: This feature doesn't seem to be used extensively since the page hasn't been edited for 3 years. Is it worth the effort? At least, I made the URL configurable in the advanced settings.
  • Linking to overpass-turbo: Since the commit SHA is specified, the code shouldn't change overtime (unless the repository is removed completely or a heavy git rebase is performed. The question for me is whether we a core feature should require a download of 4 JavaScript files upon first usage?

comment:5 Changed 4 years ago by simon04

Milestone: 15.09

Like for #11755, I submitted a few upstream pull-requests to ease the integration of the JavaScript library https://github.com/tyrasd/overpass-turbo/pull/189, https://github.com/tyrasd/overpass-turbo/pull/191, https://github.com/tyrasd/overpass-turbo/pull/192

We end up with a 41K (not yet zipped) JavaScript file which can be bundled with JOSM. So the fetching of four js files from github.com upon first usage is now gone. Plus, we have two test cases. :)

comment:6 Changed 4 years ago by Don-vip

Keywords: turbo js javascript added
Priority: normalmajor

comment:7 Changed 4 years ago by simon04

Owner: changed from team to simon04

comment:8 Changed 4 years ago by simon04

In 8684/josm:

see #11428 - Add Overpass download dialog to core, provide Overpass Turbo wizard

comment:9 Changed 4 years ago by simon04

Resolution: fixed
Status: newclosed

Adapted mirrored_download plugin: [o31520], [o31521].

comment:10 Changed 4 years ago by Don-vip

In 8685/josm:

see #11428 - fix checkstyle issues

comment:11 Changed 4 years ago by Klumbumbus

How do I use this feature? I don't have such a box like in the screenshot of comment:2

I use latest r8685.

Changed 4 years ago by simon04

comment:12 Changed 4 years ago by simon04

You would use File → Download from Overpass API (this had been provided by the mirrored_download plugin before [o31520]). Then you would see a dialog like attachment:2015-08-24-093410_998x581_scrot.png

comment:13 Changed 4 years ago by Don-vip

Is the mirrored download plugin still useful by the way?

comment:14 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: closedreopened

I tried the railway=tram example and I get the following error:

IO Exception

Failed to upload data to or download data from 'https://overpass-api.de/api/interpreter?data=%5Bbbox%5D%5Btimeout%3A25%5D%3B%0A%2F%2F+gather+results%0A%28%0A++%2F%2F+query+part+for%3A+%E2%80%9Crailway%3Dtram%E2%80%9D%0A++node%5B%22railway%22%3D%22tram%22%5D%3B%0A++way%5B%22railway%22%3D%22tram%22%5D%3B%0A++relation%5B%22railway%22%3D%22tram%22%5D%3B%0A%29%3B%0A%2F%2F+print+results%0Aout+meta%3B%0A%3E%3B%0Aout+meta%3B&bbox=12.8289413,50.6851478,12.8708267,50.7164607' due to a problem with transferring data. Details (untranslated): handshake alert: unrecognized_name

from the console:

INFO: GET https://overpass-api.de/api/interpreter?data=%5Bbbox%5D%5Btimeout%3A25%5D%3B%0A%2F%2F+gather+results%0A%28%0A++%2F%2F+query+part+for%3A+%E2%80%9Crailway%3Dtram%E2%80%9D%0A++node%5B%22railway%22%3D%22tram%22%5D%3B%0A++way%5B%22railway%22%3D%22tram%22%5D%3B%0A++relation%5B%22railway%22%3D%22tram%22%5D%3B%0A%29%3B%0A%2F%2F+print+results%0Aout+meta%3B%0A%3E%3B%0Aout+meta%3B&bbox=12.9183769,50.8297945,12.92799,50.8353239
ERROR: javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
	at sun.security.ssl.ClientHandshaker.handshakeAlert(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:158)
	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:147)
	at org.openstreetmap.josm.actions.OverpassDownloadAction$OverpassDownloadReader.parseOsm(OverpassDownloadAction.java:216)
	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(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
ERROR: org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.. Cause: javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
org.openstreetmap.josm.io.OsmTransferException: Could not connect to the OSM server. Please check your internet connection.
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:161)
	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:147)
	at org.openstreetmap.josm.actions.OverpassDownloadAction$OverpassDownloadReader.parseOsm(OverpassDownloadAction.java:216)
	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(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
	at sun.security.ssl.ClientHandshaker.handshakeAlert(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:158)
	... 14 more


comment:15 Changed 4 years ago by simon04

@Klumbumbus: Uff, Java (on Windows?) does not like the StarCom SSL certificate. Please try setting download.overpass.url to http://overpass-api.de/api/. Do we need to stick to HTTP due to this certificate issue?

@Don-vip: The plugin (1) features XAPI queries (which is somehow superseded by the overpass turbo query wizard), (2) a UI for changing the Overpass server, and (3) the "mirror mode" (downloading the unfiltered data from the Overpass server). (1) could be dropped perhaps, (3) should be easy to add and I don't know about (2).

comment:16 in reply to:  15 Changed 4 years ago by Klumbumbus

Replying to simon04:

Please try setting download.overpass.url to http://overpass-api.de/api/.

This works for me.

comment:17 Changed 4 years ago by naoliv

Could we have some kind of history in this dialog?
For example, I would like to see some of my last queries stored somewhere.

comment:18 Changed 4 years ago by naoliv

Another could: could we also have an option to select the overpass server?
For example, right now https://overpass-api.de/api/ is giving timeout while http://overpass.osm.rambler.ru/cgi/ works.

comment:19 Changed 4 years ago by simon04

In 8688/josm:

see #11428 - Make Overpass server configurable

comment:20 in reply to:  15 Changed 4 years ago by simon04

Replying to simon04:

@Klumbumbus: Uff, Java (on Windows?) does not like the StarCom SSL certificate. Please try setting download.overpass.url to http://overpass-api.de/api/. Do we need to stick to HTTP due to this certificate issue?

r8688 defaults to HTTP to avoid this certificate issue.

@Don-vip: The plugin (1) features XAPI queries (which is somehow superseded by the overpass turbo query wizard), (2) a UI for changing the Overpass server, and (3) the "mirror mode" (downloading the unfiltered data from the Overpass server). (1) could be dropped perhaps, (3) should be easy to add and I don't know about (2).

(3) is already implemented (one has to empty the query field). (2) has come with r8688.

Can we deprecate the mirrored_download plugin?

comment:21 Changed 4 years ago by simon04

In 8689/josm:

see #11428 - Make Overpass download an expert action

comment:22 Changed 4 years ago by simon04

In 8711/josm:

see #11428 - Overpass Download: use Monospace font for query

comment:23 Changed 4 years ago by simon04

In [o31534:31535]:

JOSM/mirrored_download: Drop shortcut in favour of JOSM core action

comment:24 Changed 4 years ago by simon04

In 8712/josm:

see #11428 - Overpass Download: take nice shortcut from mirrored_download plugin

comment:25 Changed 4 years ago by simon04

In 8713/josm:

see #11428 - Overpass Download: make help work

comment:26 Changed 4 years ago by simon04

In 8716/josm:

see #11428 - Overpass Download: use JosmTextArea for monospace font

comment:27 Changed 4 years ago by simon04

Summary: [Patch] Add Overpass download dialog to core, provide Overpass Turbo wizardAdd Overpass download dialog to core, provide Overpass Turbo wizard

comment:28 Changed 4 years ago by skyper

See also #7647 and #7670.

comment:29 in reply to:  17 Changed 4 years ago by simon04

Replying to naoliv:

Could we have some kind of history in this dialog?
For example, I would like to see some of my last queries stored somewhere.

See #10023.

comment:30 Changed 4 years ago by simon04

In 8744/josm:

see #11428 - Refactoring (class/package structure)

comment:31 Changed 4 years ago by simon04

In 8745/josm:

see #11428 - Deprecate mirrored_download plugin which is part of core

comment:32 Changed 4 years ago by simon04

In [o31543]:

JOSM/mirrored_download: Remove mirrored_download plugin (has been integrated to JOSM core in 2015-08, see #josm11428)

comment:33 Changed 4 years ago by simon04

Resolution: fixed
Status: reopenedclosed

:-)

comment:34 Changed 4 years ago by simon04

In 8782/josm:

see #11428 - Extract Overpass request errors

Those error messages are nicely displayed in the error dialog.

This is a workaround for https://github.com/drolbr/Overpass-API/issues/94

Changed 4 years ago by simon04

Example for syntax error reporting

comment:35 Changed 4 years ago by simon04

In 8787/josm:

see #11428 - Change Overpass task name in progress monitor to "Contacting Server..."

comment:36 Changed 4 years ago by mmd

@Don-vip : as a solution outside of Overpass API is now in place, there's nothing left to do in https://github.com/drolbr/Overpass-API/issues/94

Could you please close your GitHub ticket?

Thanks

comment:37 in reply to:  31 Changed 4 years ago by baditaflorin

Replying to simon04:

In 8745/josm:

see #11428 - Deprecate mirrored_download plugin which is part of core

Where exactly can you find the mirrored_download plugin ?\

The beauty of mirrored_download is that you can search by only saying

[highway=*]

Now i can only find Overpass Api , where i have to start defining things ... i don`t have a list of exception ...

comment:38 Changed 4 years ago by simon04

It has been removed in favour of the query wizard, see comment:15. You can input highway=* in the query wizard field and obtain an Overpass query.

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.