Opened 14 years ago
Closed 13 years ago
#6251 closed enhancement (fixed)
[PATCH] Download multiple objects on Ctrl-Shift-O
Reported by: | akks | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description (last modified by )
Another idea from Russian forum:
Download multiple objects - extending the functionality of Ctrl-Shift-O.
Object numbers can be entered with any separator (Select 'nodes' / enter "12334 3432 ,234 45534").
String.split and a loop will do all the work, but validating text field needs some modification or replacement...
We can of course write separate plugin but simple extending the core functionality is better.
What is your opinion?
Attachments (3)
Change History (29)
comment:1 by , 14 years ago
Version: | → latest |
---|
comment:2 by , 14 years ago
Description: | modified (diff) |
---|
comment:3 by , 14 years ago
comment:4 by , 14 years ago
What to do with the line edit? Replace with simple editor and validate manually, showing messagebox?
comment:5 by , 14 years ago
I have no idea yet. I can only judge a solution you present whether it is acceptable or not. Solutions must be generic (i.e. no special solutions for one use case, which users don't need or even recognize) and easy understandable by users. Nearly everything which fits these criteria is acceptable.
follow-up: 9 comment:7 by , 14 years ago
Please review my patch, allowing to enter multiple ID's in Chtl-Shift-O dialog.
ID list can be
1 2 4
2, 5,7 +41
123,v1 24,v2 [ copy from openstreetmap.org, v-words are skipped ]
and almost any format.
Download is one-by-one, but this allows us to skip possible server errors.
comment:8 by , 14 years ago
Summary: | Download multiple objects on Ctrl-Shift-O → [PATCH] Download multiple objects on Ctrl-Shift-O |
---|
comment:9 by , 14 years ago
Replying to akks:
Please review my patch, allowing to enter multiple ID's in Chtl-Shift-O dialog.
ID list can be
1 2 4 2, 5,7 +41 123,v1 24,v2 [ copy from openstreetmap.org, v-words are skipped ]and almost any format.
In the current form, it is a hidden feature. It would be much more useful, if it was more accessible. A short explanation text below the input field wouldn't hurt, see "Add Node..." dialog for an example.
Download is one-by-one,
Why not download this in chunks with MultiFetchServerObjectReader? This would be faster and cause less network traffic, especially if someone tries to download a large number of objects.
but this allows us to skip possible server errors.
I don't understand this.
Another feature request by me (just take it as an idea):
- add combobox option "auto" and enter
n4523432,n523324,w45433,r1234
This way you don't need a mouse for the whole process.
follow-up: 11 comment:10 by , 14 years ago
In the current form, it is a hidden feature. It would be much more useful, if it was more accessible. A short explanation text below the input field wouldn't hurt, see "Add Node..." dialog for an example.
ОК, if this window structure is accepted I'll write some text.
Why not download this in chunks with MultiFetchServerObjectReader? This would be faster and cause less network traffic, especially if someone tries to download a large number of objects.
I'll try.
I don't understand this.
If one node is unavailable, should others be downloaded? I think, yes.
n4523432,n523324,w45433,r1234
I tried to start with combobox option, but its model is connected with primitiveTypes... More code is needed of course to do this.
comment:11 by , 14 years ago
Replying to akks:
Why not download this in chunks with MultiFetchServerObjectReader? This would be faster and cause less network traffic, especially if someone tries to download a large number of objects.
I'll try.
I don't understand this.
If one node is unavailable, should others be downloaded? I think, yes.
When trying to fetch a deleted node with
http://api.openstreetmap.org/api/0.6/node/1020424609
it gives 410, but with multi fetch api call
http://api.openstreetmap.org/api/0.6/nodes?nodes=1020424609
return the last version of the node, correctly with visible=false
attribute. So multi fetch might be better either way.
The only thing where the server complains for multi fetch, is when id < 0 or id > LARGEST_ID_IN_DATABASE.
Maybe a warning is in order, when some of the downloaded objects are deleted.
follow-up: 13 comment:12 by , 14 years ago
i have started to edit the code, but MultiFetchServerObjectReader need some more time. I think I will copy and remake DownloadReferrersTask. I found no function for batch downloading collection of primitives.
Maybe someone could do it better?
comment:13 by , 14 years ago
Replying to akks:
i have started to edit the code, but MultiFetchServerObjectReader need some more time.
I can wait... :)
I think I will copy and remake DownloadReferrersTask. I found no function for batch downloading collection of primitives.
There is no such function because it was not needed so far. But I think a lot of work in this direction has already been done, and you can "cheat" by looking at DownloadReferrersTask and similar uses of MultiFetchServerObjectReader.
follow-up: 16 comment:15 by , 14 years ago
New version of patch, that uses new general downloading task based on MultiFetchServerObjectReader.
I really do not know how to implement "download referrers" feature correctly and how to check MultiFetchServerObjectReader errors.
All other features seem to work.
by , 14 years ago
Attachment: | multiDownload.patch added |
---|
comment:16 by , 13 years ago
Replying to akks:
New version of patch, that uses new general downloading task based on MultiFetchServerObjectReader.
I really do not know how to implement "download referrers" feature correctly
I guess one by one
and how to check MultiFetchServerObjectReader errors.
Before applying the patch, I will add some user feedback for 404 (unknown id) and when some of the downloaded primitives happen to be deleted. But it can take a few days.
follow-up: 18 comment:17 by , 13 years ago
I think it would be better to wait)
It was not even my idea to add this feature, it just _seemed_ easy enough to implement
comment:18 by , 13 years ago
Replying to akks:
I think it would be better to wait)
It was not even my idea to add this feature, it just _seemed_ easy enough to implement
Is this is sarcasm? I don't get it. Many things seem easy at first and turn out to be more complicated. If you don't want to go that road, it's your call, we all do it in our spare time.
If someone else completes your unfinished work, you should be thankful, that is nothing that can be expected in open source world.
comment:19 by , 13 years ago
My English is not well enough. I am not only thankful, but actually happy that someone else can complete this work (now have no time at all..)
Sarcasm is addressed to myself - I was rather naive when started implementing this feature (I even did not need it myself, but thought it should be _very_ easy and fast)
comment:23 by , 13 years ago
Priority: | normal → major |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
This patch has partially broken the Downloading objects.
When I went to usually go to download a relation, when I had the "Download referrers" box clicked, it would also download all the ways that were part of the relation. That is now completely broken.
Example: Download relation 1027748. In r4079, if you downloaded it and had the "Download referrers" box clicked, it would automatically download all of the ways that were in that relation. But in r4088 that was released today, it doesn't do that anymore.
So, can this please get fixed? Thanks.
comment:24 by , 13 years ago
By the way, old way downloads all relation members even if "Download referrers" is not checked. So the problem is in new DownloadPrimitivesTask? I will try to make a patch soon.
by , 13 years ago
Attachment: | downloadMultiple2.patch added |
---|
Restored incomplete relations download, added automatic zoom.
comment:25 by , 13 years ago
Comment 24 was mine too) All seems to work as expected now (with patch)
Patches welcome.