UrbanAnalyst / dodgr

Distances on Directed Graphs in R
https://urbananalyst.github.io/dodgr/
127 stars 16 forks source link

Suggestion: Add a `timeout` or `...` argument to `dodgr_streetnet()` that are passed to `osmdata::opq()` #157

Closed agila5 closed 3 years ago

agila5 commented 3 years ago

I think that could help to download data from OSM where there are problems with the internet/wifi connection:

dodgr::dodgr_streetnet(
  bbox = c(xmin = 87.5, ymin = 22, xmax = 88.5, ymax = 23), 
  expand = 0.005, 
  quiet = FALSE
)
#> Issuing query to Overpass API ...
#> Rate limit: 0
#> Query complete!
#> Error in check_for_error(doc): General overpass server error; returned:
#> The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. runtime error: Query timed out in "query" at line 3 after 26 seconds.

Created on 2021-06-04 by the reprex package (v2.0.0)

mpadge commented 3 years ago

Those errors arise from rate limiting within overpass itself, and are pretty useful for diagnosing when queries are simply too large. In my opinion, it would be more useful for not somewhere within the dodgr_streetnet documentation that these error messages generally indicate that a query is too large, and it needs to be refined. A timeout argument will not help, because overpass will still apply the same rate limit - that value of 26 seconds is an internal timeout from the server itself.