Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
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&...
geotheory's user avatar
  • 23.3k
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$...
atatam_anukah's user avatar
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) ...
Giuseppe Petri's user avatar
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(...
tnt's user avatar
  • 1,418
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 ...
stobot's user avatar
  • 13
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/...
mirabug's user avatar
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 ...
Recology's user avatar
  • 137
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(...
Salvador's user avatar
  • 1,467
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 ...
Eric Green's user avatar
  • 7,623
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 ...
Simon Woodward's user avatar
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) ...
Jake L's user avatar
  • 1,037
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 ...
SiH's user avatar
  • 1,516
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 ...
Faraz's user avatar
  • 67
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 ...
BEVAN's user avatar
  • 450
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 = -...
AlexLee's user avatar
  • 441

15 30 50 per page