#12469 closed enhancement (fixed)
update overpass wizard code
Reported by: | tyr_asd | Owned by: | simon04 |
---|---|---|---|
Priority: | normal | Milestone: | 16.02 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
The overpass wizard (javascript) code used in JOSM's Download from Overpass API utility should be updated to use the recently published standalone module: https://github.com/tyrasd/overpass-wizard.
The new module has a couple of options which modify the output of the wizard. So, it can be set up to produce a query with recursive meta output, xml format and the global bbox parameter set (see https://github.com/drolbr/Overpass-API/issues/251). You could even supply your own set of presets which would be searched for free-form input, but I'd still call that feature as experimental for now.
The module doesn't come in a standalone js file (but as a node module), but you can generate one by passing it through browserify (resulting in a 28kB script after minification):
browserify -s overpassWizard index.js | uglifyjs > overpass-wizard.js
Attachments (0)
Change History (9)
comment:1 by , 9 years ago
Cc: | removed |
---|---|
Milestone: | → 16.02 |
Owner: | set to |
Priority: | minor → normal |
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
test is skipped since r9815
comment:6 by , 8 years ago
Description: | modified (diff) |
---|
comment:7 by , 8 years ago
It seems queries are not expanded, see #12939.
I have checked that running overpassWizard in the command line results in expanded queries (area(...)
), while calling the standalone version from JOSM results in raw queries (geocodeArea:...
), rejected by Overpass API.
I assumed the fix would be trivial (include expand.js as follows):
browserify -s overpassWizard index.js expand.js | uglifyjs > overpass-wizard.js
but it does not work better, although the file is much bigger.
I don't know how to solve this.
Simon, tyr_asd, can you please help me?
comment:8 by , 8 years ago
Oh, yeah. Let's see. Does your javascript engine support XMLHttpRequest and getting results out from an async js callback? If yes, than you can use the `exand.js` module[¹] that comes with overpass-wizard (even though it's still undocumented – I'll have to work on that, sorry!). Otherwise, you're probably better off re-implementing the necessary shortcut expansion code yourself in Java (you can use expand.js as a reference). I guess that you already have code to send requests to Nominatim, right? In which cast this should only require some glue code here and there. (For other features of the overpass-wizard you should also implement the relative date and constants expansion, though.)
PS: I see that you're currently hardcoding a bbox-query (even for example if the users typed in a global query) by sending the bbox parameter with every Overpass request. Don't forget to rework that as well. ;-)
[¹] probably use browserify -s expand expand.js
to generate a separate compiled module.
comment:9 by , 8 years ago
thanks for your feedback :) I think I will then rewrite the shortcut expansion in Java, as we have everything we need for Nominatim and keeping control on network connections is a better approach for JOSM (we have a lot of centralized stuff for everything network-related).
In 9704/josm: