I'm using the rivers_lake_centerlines
dataset from rnaturalearth
to plot rivers on a map in R. The map is produced with ggmap
. My workflow:
# download and save river drainages as an object
rivers10 <- ne_download(scale = 10, type = 'rivers_lake_centerlines', category = 'physical')
# set my coordinate extents for plotting with `ggmap`
myLocation <- c(-109.5, 37, -103, 31.5)
# get the map I want to use for plotting river drainages with `ggmap` function `getmap`
# save as an object
map1 <- get_map(location=myLocation, crop = F,
color="bw",
maptype="terrain",
source="google",
zoom=8)
sitemap <- ggmap(map1, extent = 'device') # use the BW terrain option
rivers_df <- fortify(rivers10) # make river data spatial for ggplot
# plot map with river data
sitemap +
labs(x = "Longitude", y = "Latitude") +
geom_path(
data = rivers_df,
aes(long, lat, fill = NULL),
color = "#2A788EFF",
alpha = 0.5)
Plot produced:
My question: Why am I getting the rivers plotted as oddly shaped straight lines?