[josm-dev] How to use DownloadTask in Python/Jython

Paul Hartmann phaaurlt at gmail.com
Sun Jan 18 00:58:54 UTC 2015


On 17.01.2015 00:27, Jo wrote:
> Hi Paul,
>
> Many thanks for your help. f.get() makes the script hang forever.

Maybe the script and the download are run by the same Executor 
(Main.worker). Then this would block. You can try to run your entire 
script in a new background thread. (Code example: 
http://stackoverflow.com/a/12551542)

> The other problem is that I don't see how to restrict it to the bbox I
> zoomed in upon. So the script downloads all the routes with that same ref
> all over the region, for the operator in question.

This shouldn't be too hard, call Main.map.mapView.getRealBounds() to get
the current bbox and integrate these parameters into the overpass query.

Paul



More information about the josm-dev mailing list