Opened 12 years ago
Closed 12 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 Changed 12 years ago by
Version: | → latest |
---|
comment:2 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
What to do with the line edit? Replace with simple editor and validate manually, showing messagebox?
comment:5 Changed 12 years ago by
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.
comment:6 Changed 12 years ago by
I'll wait for other possible comments and implement it some time later.
comment:7 follow-up: 9 Changed 12 years ago by
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 Changed 12 years ago by
Summary: | Download multiple objects on Ctrl-Shift-O → [PATCH] Download multiple objects on Ctrl-Shift-O |
---|
comment:9 Changed 12 years ago by
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.
comment:10 follow-up: 11 Changed 12 years ago by
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 Changed 12 years ago by
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.
comment:12 follow-up: 13 Changed 12 years ago by
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 Changed 12 years ago by
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.
comment:15 follow-up: 16 Changed 12 years ago by
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.
Changed 12 years ago by
Attachment: | mutidownload.patch added |
---|
ability to download multible objects by ID
Changed 12 years ago by
Attachment: | multiDownload.patch added |
---|
comment:16 Changed 12 years ago by
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.
comment:17 follow-up: 18 Changed 12 years ago by
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 Changed 12 years ago by
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 Changed 12 years ago by
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:22 Changed 12 years ago by
I changed a few things, please test if everything works as expected.
comment:23 Changed 12 years ago by
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 Changed 12 years ago by
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.
Changed 12 years ago by
Attachment: | downloadMultiple2.patch added |
---|
Restored incomplete relations download, added automatic zoom.
comment:25 Changed 12 years ago by
Comment 24 was mine too) All seems to work as expected now (with patch)
Patches welcome.