QuickOSM
QuickOSM copied to clipboard
"Bad request OverpassAPI"
What is the bug?
When attempting to make a Quick Query, I get the error message:
Bad request OverpassAPI.
This happens no matter what kind of query I make. An example of one is:
[out:xml] [timeout:25];
{{geocodeArea:White Plains, NY}} -> .area_0;
(
node["building"](area.area_0);
way["building"](area.area_0);
relation["building"](area.area_0);
);
(._;>;);
out body;
I had an older version of QuickOSM installed before, and I got the same error, which is what prompted me to upgrade the plug-in. Having done that, I'm still getting the same issue.
Environment
- QuickOSM version: 2.0.0
- QGIS version: 3.18.1
- OS: Windows 10
In the small comic strip bubble in the bottom right corner of QGIS, can you copy/paste all logs from the QuickOSM tab ?
Thank you for getting back to me!
Running it today, I'm getting a different error actually. Here is the log:
2021-10-06T10:24:18 INFO Request completed
2021-10-06T10:24:18 INFO Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3600174495) -%3E .area_0;%0A(%0A node[%22building%22](area.area_0);%0A way[%22building%22](area.area_0);%0A relation[%22building%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-06T10:25:18 CRITICAL Download failed: Operation canceled
I haven't attempted increasing the timeout time, but before these problems arose, a query like this never took more than a few seconds, and I'm on a stable internet connection.
Adding onto the previous comment, QuickOSM gives the following error message:
Overpass API : Download failed: Connection timed out
With the log:
2021-10-06T10:31:31 INFO All OSM objects with the key 'building' in White Plains, NY are going to be downloaded.
2021-10-06T10:31:31 INFO Query: building_White Plains, NY
2021-10-06T10:31:31 INFO Request completed
2021-10-06T10:31:31 INFO Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3600174495) -%3E .area_0;%0A(%0A node[%22building%22](area.area_0);%0A way[%22building%22](area.area_0);%0A relation[%22building%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-06T10:32:13 CRITICAL Download failed: Connection timed out
That sounds like a huge area to download data from, does it work if you restrict the query to a much smaller extent?
Try to set a higher timeout so that the API has time to get the data to you, see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#timeout: which you can set in QuickOSM too.
If you can, use data extracts for big general queries like that. Eg. http://download.geofabrik.de/north-america.html or via https://extract.bbbike.org/
Before this issue appeared, I had extracted much larger data before with no problem. The White Plains, NY area doesn't have many features to pull from. Nevertheless, I chose a much smaller extent from which to pull "building" features from, and I got a different error this time. I also extended the timeout time to 60 instead of the default 25:
Overpass API : Download failed: Error transferring https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin - server replied: Gateway Timeout
And this is the log:
2021-10-07T12:50:03 INFO Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-07T12:50:20 CRITICAL Download failed: Error transferring https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin - server replied: Gateway Timeout
Please try it even smaller with an even longer timeout value. Is there a firewall or proxy between you and the API server?
I'm also experiencing issue, with very small query.
This query returns nothing :
https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3602307203) -%3E .area_0;%0A(%0A node[%22shop%22%3D%22bakery%22](area.area_0);%0A way[%22shop%22%3D%22bakery%22](area.area_0);%0A relation[%22shop%22%3D%22bakery%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
while this one works :
https://z.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3602307203) -%3E .area_0;%0A(%0A node[%22shop%22%3D%22bakery%22](area.area_0);%0A way[%22shop%22%3D%22bakery%22](area.area_0);%0A relation[%22shop%22%3D%22bakery%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
The only difference is lz4.overpass-api.de
-> z.overpass-api.de
.
Can you change this settings ? (last tab in QuickOSM).
I also saw it here as well : https://gis.stackexchange.com/questions/413264/quick-osm-is-giving-bad-request/413265#413265
Changing lz4.overpass-api.de
to z.overpass-api.de
seems to have worked. Thank you so much for the help!
We should keep the ticket open. It's an issue. It must be reported upstream on overpass and maybe change the default server in QuickOSM.
Maybe it is worth checking api status at https://wiki.openstreetmap.org/wiki/Overpass_API/status
Thanks for the link @stephan75 So it seems the default server set in QuickOSM is having issues these days. I will add the link in the plugin.