Closed beemyfriend closed 6 years ago
Nice catch Ben! It should now work like this (with bboxes and stuff adjusted to give a smaller map):
trial <- get_bbox(c(-75.1, 39.9, -75.16, 39.99))
schuylkill <- cbind(c(-75.15, -75.1, -75.1, -75.15),
c(39.9, 39.9, 39.94, 39.94))
osm_basemap(trial, bg = 'gray80') %>%
add_osm_objects(dat_H, col = "skyblue") %>%
add_osm_groups(dat_W", groups = schuylkill,
cols = 'blue', bg = 'yellow', make_hull = T) %>%
add_axes() %>%
print_osm_map()
The polygons don't quite match up for reasons described in the vignette. As suggested there, it's best in such cases to first plot the object using the desired bg
colour, and then overlay with add_osm_groups()
. Otherwise this should now do what you want.
I'm trying to isolate the Schuylkill River from the rest of my map. The following code works with
add_osm_objects()
:However, when I try to isolate the river by using
add_osm_groups()
, the waterway is completely ignored. It neither turns blue (representing that it is part of the group) nor turns yellow (representing that it is not part of the group):I'm confident that my grouping box is accurate. I am not sure what the issue is. Could it be with the feature type ('waterway') or am I missing something really obvious?