I'm trying to match up images generated with ggmap to some other geo data and running into odd behaviour.
The simplest way I can explain is that if I run the following to request a Stamen map, it will overlay nicely with my other data.
map_out <- ggmap::get_map("54.5234,-3.0232", zoom =12, source = "stamen", maptype = "watercolor")
ggmap::ggmap(map_out)
If I run exactly the same thing but requesting a Google Map, the image is offset to the north west.
map_out <- ggmap::get_map("54.5234,-3.0232", zoom =12, source = "google", maptype = "terrain")
ggmap::ggmap(map_out)
The coordinates on the two plots are identical but the Google one is offset north west. I'm blaming the Google map because Stamen matches up with other data so I think it's a Google issue.
I've read a few posts saying Google uses the projection "+init=epsg:3857" but using that projection makes Stamen match up properly but not Google.
Does anyone know if there's something special about Google Maps? Does it need a different projection?
Supposedly Google uses epsg:3857 but surely it can't be exactly that or it wouldn't be offset?
Edit: Regular web based Google Maps says the latitude of the southern end of Thirlmere (the lake in the middle) is 54.51 so the ggmap Google image above is definitely in the wrong place.
Cracked it, the error was because I specified the lat long as character.
This one works properly.
map_out <- ggmap::get_map(c(-3.0232, 54.5234), zoom =12, source = "google", maptype = "terrain")