Closed Robinlovelace closed 4 years ago
Same with the original example:
library(stplanr); (from <- geo_code("gzine leeds"))
#> Registered S3 method overwritten by 'R.oo':
#> method from
#> throw.default R.methodsS3
#> numeric(0)
(to <- geo_code("pedallers arms leeds"))
#> [1] -1.532771 53.800699
# next 4 lines were used to generate `stplanr::osm_net_example`
pts <- rbind(from, to)
colnames(pts) <- c("X", "Y")
net <- dodgr::dodgr_streetnet(pts = rbind(from, to), expand = 0.1)
#> Error in process_bbox(bbox, pts, expand): Can not unambiguously determine coordinates in graph
Created on 2019-10-03 by the reprex package (v0.3.0)
That because you've got
dodgr_streetnet(pts = rbind (from, to), ...)
and not
dodgr_streetnet(pts = pts, ...)
The pts
have to be named, otherwise it's not clear what is "x"
and what is"y"
. I think that error is okay, right?
Yes that solves it, thanks, glad I checked!
Not sure what's causing this or if it's even an issue, but it pops up from commented lines in stplanr that I think should be reproducible:
Created on 2019-10-03 by the reprex package (v0.3.0)