I feel like I'm going crazy. I've been having this simple osmdata query failing over and over again, so I opened a separate rstudio project to make a reprex, and over there it works fine. I've cleared the workspace, cleared the output, restarted the session, and it still fails. Created a new markdown in the failing session, did a copy and paste from the reprex, and it still fails. I am at my wits end. Here is the code, and the two different responses I get running it:
library(tidyverse)
googlecrs <- "EPSG:4326" # lat long
big_streets <-
osmdata::getbb(place_name = "Houston") %>%
osmdata::opq()%>% # Build query
osmdata::add_osm_feature(key = "highway",
value = c("motorway",
"motorway_link"
)) %>% # select the big roads
osmdata::osmdata_sf(quiet=FALSE)
knitr::opts_chunk$set(echo = TRUE)
Failing session:
Issuing query to Overpass API ...
Error:
! HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
Backtrace:
1. ... %>% osmdata::osmdata_sf(quiet = FALSE)
2. osmdata::osmdata_sf(., quiet = FALSE)
3. osmdata:::fill_overpass_data(obj, doc, quiet = quiet)
4. osmdata:::overpass_query(...)
5. osmdata::overpass_status(quiet)
6. httr2::req_perform(req)
7. base::tryCatch(...)
8. base (local) tryCatchList(expr, classes, parentenv, handlers)
9. base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
10. value[[3L]](cond)
Successful session:
Issuing query to Overpass API ...
Announced endpoint: z.overpass-api.de/api/
Query complete!
converting OSM data to sf format