Modify

Opened 13 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 akks)

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)

mutidownload.patch (3.2 KB ) - added by akks 13 years ago.
ability to download multible objects by ID
multiDownload.patch (18.0 KB ) - added by akks 13 years ago.
downloadMultiple2.patch (2.0 KB ) - added by akks 13 years ago.
Restored incomplete relations download, added automatic zoom.

Download all attachments as: .zip

Change History (29)

comment:1 by akks, 13 years ago

Version: latest

comment:2 by akks, 13 years ago

Description: modified (diff)

comment:3 by stoecker, 13 years ago

Patches welcome.

comment:4 by akks, 13 years ago

What to do with the line edit? Replace with simple editor and validate manually, showing messagebox?

comment:5 by stoecker, 13 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.

comment:6 by akks, 13 years ago

I'll wait for other possible comments and implement it some time later.

comment:7 by akks, 13 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 akks, 13 years ago

Summary: Download multiple objects on Ctrl-Shift-O[PATCH] Download multiple objects on Ctrl-Shift-O

in reply to:  7 comment:9 by bastiK, 13 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.

comment:10 by akks, 13 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.

in reply to:  10 comment:11 by bastiK, 13 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.

comment:12 by akks, 13 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?

in reply to:  12 comment:13 by bastiK, 13 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.

comment:14 by anonymous, 13 years ago

I will try to finish it this week.

comment:15 by akks, 13 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 akks, 13 years ago

Attachment: mutidownload.patch added

ability to download multible objects by ID

by akks, 13 years ago

Attachment: multiDownload.patch added

in reply to:  15 comment:16 by bastiK, 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.

comment:17 by akks, 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

in reply to:  17 comment:18 by bastiK, 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 akks, 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:20 by bastiK, 13 years ago

Ok, guess I overreacted a little...

comment:21 by bastiK, 13 years ago

Resolution: fixed
Status: newclosed

In [4081/josm]:

applied #6251 (patch by akks) - Download multiple objects on Ctrl-Shift-O

comment:22 by bastiK, 13 years ago

I changed a few things, please test if everything works as expected.

comment:23 by rickmastfan67, 13 years ago

Priority: normalmajor
Resolution: fixed
Status: closedreopened

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 anonymous, 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 akks, 13 years ago

Attachment: downloadMultiple2.patch added

Restored incomplete relations download, added automatic zoom.

comment:25 by akks, 13 years ago

Comment 24 was mine too) All seems to work as expected now (with patch)

Last edited 13 years ago by akks (previous) (diff)

comment:26 by bastiK, 13 years ago

Resolution: fixed
Status: reopenedclosed

In [4090/josm]:

applied #6251 (patch by akks) - download relatin members along with relation; zoom to download

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.