You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the reprex below, adding annotation_map_tile() as the only layer in a ggplot gives the error "Scale limits cannot be mapped onto spatial coordinates", suggesting setting lims_method = "geometry_bbox" or default_crs = NULL.
However, both of those options give errors too. How is this supposed to work? For my purposes it is okay to always include the geom_sf(), but I'm reporting this in case it is actually a bug.
The point object was made by dput()ing the first row of my spatial data frame. I do not have the expertise to check if it is malformed in some way, but hopefully someone else can check.
# These fail
ggplot(data=point) +ggspatial::annotation_map_tile()
#> Error in `calc_limits_bbox()`:#> ! Scale limits cannot be mapped onto spatial coordinates in#> `coord_sf()`.#> ℹ Consider setting `lims_method = "geometry_bbox"` or `default_crs = NULL`.
ggplot(data=point) +ggspatial::annotation_map_tile() + coord_sf(lims_method="geometry_bbox")
#> Warning in min(x): no non-missing arguments to min; returning Inf#> Warning in max(x): no non-missing arguments to max; returning -Inf#> Warning in min(x): no non-missing arguments to min; returning Inf#> Warning in max(x): no non-missing arguments to max; returning -Inf#> Error in `ggspatial::annotation_map_tile()`:#> ! Problem while converting geom to grob.#> ℹ Error occurred in the 1st layer.#> Caused by error in `seq.default()`:#> ! 'from' must be a finite number
ggplot(data=point) +ggspatial::annotation_map_tile() + coord_sf(default_crs=NULL)
#> Error in `calc_limits_bbox()`:#> ! Scale limits cannot be mapped onto spatial coordinates in#> `coord_sf()`.#> ℹ Consider setting `lims_method = "geometry_bbox"` or `default_crs = NULL`.
In the reprex below, adding annotation_map_tile() as the only layer in a ggplot gives the error "Scale limits cannot be mapped onto spatial coordinates", suggesting setting
lims_method = "geometry_bbox"
ordefault_crs = NULL
.However, both of those options give errors too. How is this supposed to work? For my purposes it is okay to always include the geom_sf(), but I'm reporting this in case it is actually a bug.
The
point
object was made bydput()
ing the first row of my spatial data frame. I do not have the expertise to check if it is malformed in some way, but hopefully someone else can check.Created on 2024-10-05 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: