Skip to content

Conversation

@atlefren
Copy link
Contributor

I used this project to send the following query:

area["ISO3166-1"="US"]->.search; ( node[industrial=brewery](area.search); node[microbrewery=yes](area.search); node[craft=brewery](area.search); way[industrial=brewery](area.search); way[microbrewery=yes](area.search); way[craft=brewery](area.search); relation[industrial=brewery](area.search); relation[microbrewery=yes](area.search); relation[craft=brewery](area.search); ); out geom; 

But after a while I got an empty response. After digging a bit more I found that the overpass API returned a response akin to the one described here: drolbr/Overpass-API#104

Strangely enough the response had a 200 OK status code, so this lib continued to return the empty elements array, leaving me none the wiser.

This PR tries to remedy this, by raising a ServerRuntimeError exception when this happens.

@tbolender
Copy link
Collaborator

Do you always receive an empty response or only sometimes? Which Python version are you using? When I execute the request (2.7 and 3.4) I receive a TimeoutError after a while.

@atlefren
Copy link
Contributor Author

I set the timeout parameter quite high (600), using Python 2.7.6 (Ubuntu trusty)

I haven't tried all that many times, but it happened tree or four times in a row, then I started investigating and was able to make this fix (using a couple more requests), so approx 5-6 times in a row at least. Strange if you are not able to reproduce it.

@tbolender
Copy link
Collaborator

The timeout value was the key, with 600 I receive an empty response. Thank you for the pull request!

tbolender added a commit that referenced this pull request Nov 11, 2015
Handle server runtime error from overpass API
@tbolender tbolender merged commit 47c477f into mvexel:master Nov 11, 2015
@atlefren
Copy link
Contributor Author

Great, thanks for a great library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants