Modify

Opened 2 years ago

Closed 2 years ago

#6251 closed enhancement (fixed)

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

Reported by: akks Owned by: team
Priority: major 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 2 years ago.
ability to download multible objects by ID
multiDownload.patch (18.0 KB) - added by akks 2 years ago.
downloadMultiple2.patch (2.0 KB) - added by akks 2 years ago.
Restored incomplete relations download, added automatic zoom.

Download all attachments as: .zip

Change History (29)

comment:1 Changed 2 years ago by akks

  • Version set to latest

comment:2 Changed 2 years ago by akks

  • Description modified (diff)

comment:3 Changed 2 years ago by stoecker

Patches welcome.

comment:4 Changed 2 years ago by akks

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

comment:5 Changed 2 years ago by stoecker

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 2 years ago by akks

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

comment:7 follow-up: Changed 2 years ago by 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.

Download is one-by-one, but this allows us to skip possible server errors.

comment:8 Changed 2 years ago by akks

  • Summary changed from Download multiple objects on Ctrl-Shift-O to [PATCH] Download multiple objects on Ctrl-Shift-O

comment:9 in reply to: ↑ 7 Changed 2 years ago by bastiK

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: Changed 2 years ago by akks

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 in reply to: ↑ 10 Changed 2 years ago by bastiK

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: Changed 2 years ago by akks

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 in reply to: ↑ 12 Changed 2 years ago by bastiK

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 Changed 2 years ago by anonymous

I will try to finish it this week.

comment:15 follow-up: Changed 2 years ago by 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 and how to check MultiFetchServerObjectReader errors.

All other features seem to work.

Changed 2 years ago by akks

ability to download multible objects by ID

Changed 2 years ago by akks

comment:16 in reply to: ↑ 15 Changed 2 years ago by bastiK

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: Changed 2 years ago by 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

comment:18 in reply to: ↑ 17 Changed 2 years ago by bastiK

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 2 years ago by akks

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 Changed 2 years ago by bastiK

Ok, guess I overreacted a little...

comment:21 Changed 2 years ago by bastiK

  • Resolution set to fixed
  • Status changed from new to closed

In [4081/josm]:

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

comment:22 Changed 2 years ago by bastiK

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

comment:23 Changed 2 years ago by rickmastfan67

  • Priority changed from normal to major
  • Resolution fixed deleted
  • Status changed from closed to 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 2 years ago by anonymous

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 2 years ago by akks

Restored incomplete relations download, added automatic zoom.

comment:25 Changed 2 years ago by akks

Comment 24 was mine too) All seems to work as expected now.

Version 0, edited 2 years ago by akks (next)

comment:26 Changed 2 years ago by bastiK

  • Resolution set to fixed
  • Status changed from reopened to closed

In [4090/josm]:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.