[josm-dev] How to use DownloadTask in Python/Jython
Jo
winfixit at gmail.com
Sun Jan 18 12:37:33 UTC 2015
Hi Paul,
Many thanks for your help. Unfortunately I gave up on trying to get it to
work. So I rewrote the script in such a way that the user can decide to
download data and if they do, then the script will terminate and they'll
have to run it once again, so it can perform the rest of the work.
(Comparing bus stops in route relations; some being template routes from an
external source, the others from the existing data. Then presenting them,
so they can be matched and handed to another script, which updates the
existing route based on the template).
I can see that the download is occurring and even completes, and I can even
manage to get several pieces of code run concurrently (which may come in
handy some day, learned a new trick there), but the freshly downloaded data
only gets merged into the layer after the script terminates.
Cheers,
Jo
2015-01-18 2:06 GMT+01:00 Jo <winfixit at gmail.com>:
> Oh, I've been debugging for the past hour and preparing the message which
> crossed yours. In the mean time I had come to the conclusion it'd be best
> to include the bounds in the Overpass, but I hadn't gotten around to it yet.
>
> I'm going to look into running it with another background thread.
>
> Thanks!
>
> Jo
>
> 2015-01-18 1:58 GMT+01:00 Paul Hartmann <phaaurlt at gmail.com>:
>
>> 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
>>
>> _______________________________________________
>> josm-dev mailing list
>> josm-dev at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/josm-dev
>>
>
>
More information about the josm-dev
mailing list