Opened 7 days ago

Last modified 2 days ago

#18122 new defect

Don't set download bounds for incomplete Overpass queries

Reported by: stoecker Owned by: team
Priority: normal Milestone: 19.09
Component: Core Version:
Keywords: overpass download bounds incomplete Cc:


Incomplete downloads should not set download bounds, as most functions in JOSM assume that data inside download bounds is complete.

See #18116

Attachments (2)

18122-quick-and-dirty.patch (4.0 KB) - added by GerdP 6 days ago.
18122-v1.patch (6.9 KB) - added by GerdP 5 days ago.

Download all attachments as: .zip

Change History (5)

Changed 6 days ago by GerdP

Attachment: 18122-quick-and-dirty.patch added

comment:1 Changed 6 days ago by GerdP

A few remarks:
1) I think one should remember that the normal OSM API will not return ways crossing the bounds unless at least one node of the way is inside the bounds.
2) We have two types of overpass queries:

  • Those which are intended to download partial data because they use filters like highway=*.
  • Those which are intended to download full data for the given bounds.

Unfortunately the download tasks only "sees" the final query which doesn't clearly say which type we have. A quick&dirty solution could parse the overpass query for e.g. "node({{bbox}})" to detect full downloads, but it would be better to store that information somewhere.
3) Downloads (also those from OSM API) might return empty datasets. The current code in DownloadOsmTask.finish() always adds bounds to the DataSet instance in this case. We have to avoid that for partial downloads.

The quick hack allows to experiment, but it will fail if someone executes an overpass query which contains the string "node({{bbox}})" in a comment and the change in DownloadOsmTask.finish() doesn't care if the download was partial or not.

Changed 5 days ago by GerdP

Attachment: 18122-v1.patch added

comment:2 Changed 5 days ago by GerdP

patch v1 might be enough to solve the problem. I see no need to add the "empty" query. Up to now we generated something like

Place your Overpass query below or generate one using the Overpass Turbo Query Wizard
(._;>;);out meta;

if the user query was empty or just a comment. I see no need to include that comment in the "repaired" query, instead a static String is used and I think it is clean to compare the query again this static string to detect a full query?

comment:3 Changed 2 days ago by Don-vip

Keywords: overpass download bounds incomplete added

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to stoecker
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

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

Note: See TracTickets for help on using tickets.