calc_zoom returns Inf if coordinates in a straight line
- Dominant language
- R
- Stars
- 778
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
It seems that calc_zoom will return Inf if all the coordinates are in a straight line, both in the longitude or latitude direction. Please see below for a reproducible example.
These all fail
````
list(
a=data.frame(rbind(c(0,0),c(0,1))),
b=data.frame(rbind(c(0,0),c(1,0))),
c=data.frame(rbind(c(0,0),c(0,5))),
d=data.frame(rbind(c(0,0),c(0,1),c(0,2))),
e=data.frame(rbind(c(5,5),c(5,6)))
) %>%
map(~{make_bbox(X1,X2,data=.) %>% calc_zoom}) %>% unlist
````
These are successful
````
list(
x=data.frame(rbind(c(0,0),c(1,1))),
b=data.frame(rbind(c(0,0),c(1,0.1))),
c=data.frame(rbind(c(0,0),c(0.1,0.1)))
) %>%
map(~{make_bbox(X1,X2,data=.) %>% calc_zoom}) %>% unlist
````
I'm using ggmap 3.0.0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.