All Questions
28
questions
0
votes
1
answer
124
views
Is ggmap/sf still plotting point in wrong place?
Is this old bug still unresolved, or is there a reasonable workaround yet?
Some cities:
require(ggplot2)
require(ggmap)
require(sf)
cities = sf::read_sf('{
"type": "FeatureCollection&...
0
votes
1
answer
61
views
Overlay boundary plots on ggmap
I'm trying to overlay a shapefile with boundaries of NTAs in New York on a ggmap. My code is:
nta_shp <- st_read('geo_export_de8807a0-e424-4399-95ee-3f8bcc187b7a.shp')
nta_shp <- nta_shp[nta_shp$...
0
votes
1
answer
840
views
How to properly combine a polygon map on top of a raster map in r?
I would like to combine a shapefile map of some US states on top of a raster map obtained from using library ggmap.
This is the code I have
library(USAboundaries)
library(ggmap)
library(ggplot2)
...
3
votes
2
answers
693
views
setting CRS for plotting with stamenmaps
I am trying to plot a simple polygon on a map to denote the area I am interested in. To date, I have defined the polygon as and am able to plot it on it's own.
poly <- st_polygon(list(as.matrix(...
1
vote
1
answer
123
views
Is there a way to pass piped data through ggmap like you can with ggplot to the geoms?
While exploring with ggplot a common workflow is to do some data manipulation and then pipe directly into a ggplot(). When you do that, all of that manipulation flows nicely through the ggplot into ...
0
votes
0
answers
238
views
Plotting sf file ontop of ggmap
I've been trying to plot a rivers system over a ggmap and hitting a bunch of walls. Hopefully there is a good solution.
Here is where I'm getting the rivers data:
https://data.review.fao.org/map/...
1
vote
1
answer
710
views
Mapping multiple maps with density change over time in R
I am new to mapping data with R and I would like some help for a complex representation. I will try to be as clear as possible :)
I have a dataset that counts observations over time since 1950 per day ...
4
votes
0
answers
487
views
Aligning ggmap and geom_sf maps
I am having problems aligning two maps. They appear to have the same crs but still look off a bit. Notice the California-Nevada border and the California coast. Below is the code I am using:
library(...
1
vote
1
answer
900
views
plot ggmap and sf points
I'm struggling to plot a basemap from ggmap with points (sf object). The most promising solution I came across is this SO answer from @andyteucher. I tried to reproduce it below, but I'm not having ...
2
votes
1
answer
1k
views
Problems aligning ggmap crs with geom_sf and applying map limits using coord_sf
I am trying to create a map with spatial data plotted on top. I am following the example using ggmap and then adding the New Zealand coastline using geom_sf. I have two problems:
The projection of ...
0
votes
1
answer
228
views
adding polygon over map in R, CRS issues
I'm trying to plot a map of Sweden, then plot a fake shape that I created over it. I have a script that plots municipalities of Sweden:
library(ggplot2)
library(sf)
library(smoothr)
library(jsonlite)
...
5
votes
0
answers
553
views
create animation of vehicle moving along a route "with timeline of events"
This is a followup question on How to create animation of vehicle moving form A to B along a route?. I could learn how to animate vehicles moving from A to B along the route. Thanks for the help!
But ...
1
vote
1
answer
1k
views
Set Colorbar Limits in R
I am relatively new to R. I am trying to set the colorbar limits on a grid map, colored based on the average elevation of each grid in R using scale_fill_gradient(). I want to have a fixed colorbar ...
3
votes
0
answers
348
views
Export ggplot based maps as georeferenced pdf
Is there a way to export maps created using ggplot with ggmap and and the sf package as georeferenced pdfs? I am making maps that combine a basemap with polygon, point, and label layers using ggmap ...
1
vote
1
answer
184
views
Removing the grey shading outside of masked raster in ggmaps
I have some code here for plotting a map with masked raster datapoints.
Here I define a random dataframe:
set.seed(20)
lon = seq(from = 3.4, to = 6.3, by = 0.1)
lat = seq(from = 13.3, to = 10.1, by = -...