Opened 6 years ago
Closed 6 years ago
#18122 closed defect (fixed)
Don't set download bounds for incomplete Overpass queries
Reported by: | stoecker | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 19.10 |
Component: | Core | Version: | |
Keywords: | overpass download bounds incomplete | Cc: |
Description
Incomplete downloads should not set download bounds, as most functions in JOSM assume that data inside download bounds is complete.
See #18116
Attachments (2)
Change History (15)
by , 6 years ago
Attachment: | 18122-quick-and-dirty.patch added |
---|
comment:1 by , 6 years ago
by , 6 years ago
Attachment: | 18122-v1.patch added |
---|
follow-up: 4 comment:2 by , 6 years ago
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
[out:xml]; /* Place your Overpass query below or generate one using the Overpass Turbo Query Wizard */ ( node({{bbox}}); <; ); (._;>;);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 by , 6 years ago
Keywords: | overpass download bounds incomplete added |
---|
comment:6 by , 6 years ago
I've closed the older one because Gerd already started the analysis here.
comment:7 by , 6 years ago
Milestone: | 19.09 → 19.10 |
---|
comment:8 by , 6 years ago
Seems nobody has a better idea to solve this? A clean solution would probably require a lot more changes...
comment:9 by , 6 years ago
I like the idea of detecting full map queries. But we should also detect manual coordinates. Like if someone copies this example instead of using {{bbox}}:
( node(51.249,7.148,51.251,7.152); <; ); out meta;
Also we must be tolerant to additional space characters, comments, etc. So without a full parsing capability, we still need a regex.
comment:10 by , 6 years ago
Well, I started from Dirks "better safe than sorry" approach in ticket:18116#comment:12
My patch catches at least the usual case.
My knowledge about the overpass variants is small and I am also not good with parsers and regex :(, so don't expect something more complex from me.
comment:13 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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:
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 theDataSet
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.